|
PCCS MySQLDatabase Admin Tool version 1.3.4
|
/ -> mysqldb_create_feedbackform.php
1 <?php
2 /************************************************************************
3 PCCS MySQLDatabase Admin Tool
4 Copyright (C) Chauncey Thorn
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 2
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA , USA.
19 **************************************************************************/
20 /////////////////////////////////////////////////////////////////////////////// 21 // Create Feedback Form 22 // no need to modify unless you like hacking 23 // bugs report to cthorn 24 /////////////////////////////////////////////////////////////////////////////// 25
26 $feedbackform_filename="feedback_form.php";
27
28 $feedbackform = fopen($appfiledir . $feedbackform_filename,"w");
29 fputs($feedbackform,"<?php\n//** Generated by PCCS-MyAppGen $today\n");
30 fputs($feedbackform,"/////////////////////////////////////////////////////////////////////////////////////\n");
31 fputs($feedbackform,"// coder: cthorn\n");
32 fputs($feedbackform,"////////////////////////////////////////////////////////////////////////////\n");
33 fputs($feedbackform,"//\n");
34 fputs($feedbackform,"//////////////////////////////////////////////////////////////////////////\n");
35 fputs($feedbackform,"?>\n");
36 fputs($feedbackform,"<!doctype html public \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n");
37 fputs($feedbackform,"\n");
38 fputs($feedbackform,"<html>\n");
39 fputs($feedbackform,"<head>\n");
40 fputs($feedbackform,"<title>FeedBack Form </title>\n");
41 fputs($feedbackform,"</head>\n");
42 fputs($feedbackform,"\n");
43 fputs($feedbackform,"\n");
44 fputs($feedbackform,"<style type=\"text/css\">\n");
45 fputs($feedbackform,"<!--\n");
46 fputs($feedbackform,"A:hover {color=#293a4e;}\n");
47 fputs($feedbackform,"A:{text-decoration: none}\n");
48 fputs($feedbackform,"//-->\n");
49 fputs($feedbackform,"</style>\n");
50 fputs($feedbackform,"<body bgcolor=\"#FFFFFF\" text=\"#293A4E\" link=\"#02507D\" alink=\"#02507D\" vlink=\"#02507D\">\n");
51 fputs($feedbackform,"<center>\n");
52 fputs($feedbackform,"\n");
53 fputs($feedbackform,"<table width=\"600\" cellpadding=0 cellspacing=0 border=0>\n");
54 fputs($feedbackform,"<tr>\n");
55 fputs($feedbackform,"<td align=\"Left\" bgcolor=\"White\"> </td>\n");
56 fputs($feedbackform,"<tr>\n");
57 fputs($feedbackform,"<td align=\"CENTER\" valign=\"MIDDLE\" bgcolor=\"White\">\n");
58 fputs($feedbackform," \n");
59 fputs($feedbackform,"</td>\n");
60 fputs($feedbackform,"</tr>\n");
61 fputs($feedbackform,"<tr>\n");
62 fputs($feedbackform,"\n");
63 fputs($feedbackform,"<td align=\"Right\" bgcolor=\"White\">\n");
64 fputs($feedbackform,"<font face=\"arial, heveltica\" size=\"2\" color=\"Red\" style=\"font-size: 12; font-weight:
65 normal;\">\n");
66 fputs($feedbackform," \n");
67 fputs($feedbackform,"</font>\n");
68 fputs($feedbackform,"</td></tr>\n");
69 fputs($feedbackform,"<tr>\n");
70 fputs($feedbackform,"<td colspan=2 background=\"images/back01.gif\" bgcolor=\"white\">\n");
71 fputs($feedbackform,"<br>\n");
72 fputs($feedbackform,"<center>\n");
73 fputs($feedbackform,"<table width=\"90%\">\n");
74 fputs($feedbackform,"<tr>\n");
75 fputs($feedbackform,"<td valign=\"top\">\n");
76 fputs($feedbackform,"<table cellpadding=0 cellspacing=0 border=0>\n");
77 fputs($feedbackform,"<tr>\n");
78 fputs($feedbackform,"<td align=\"CENTER\">\n");
79 fputs($feedbackform,"<font size=\"+1\" color=\"Blue\">Your FeedBack Would Help Us </font>\n");
80 fputs($feedbackform,"<p>\n");
81 fputs($feedbackform,"</td>\n");
82 fputs($feedbackform,"</tr>\n");
83 fputs($feedbackform,"\n");
84 fputs($feedbackform,"<tr>\n");
85 fputs($feedbackform,"<td align=\"LEFT\">\n");
86 fputs($feedbackform,"<center>\n");
87 fputs($feedbackform,"<table><tr>\n");
88 fputs($feedbackform,"<form action=\"sendmail.php\" method=\"post\">\n");
89 fputs($feedbackform,"<td>Name:</td><td><input type=\"text\" name=\"name\" size=\"30\"></td>\n");
90 fputs($feedbackform,"</tr><tr>\n");
91 fputs($feedbackform,"<td>Address </td><td> <input type=\"text' name=\"address\" size='35'></td>\n");
92 fputs($feedbackform,"</tr><tr>\n");
93 fputs($feedbackform,"<td>Email </td><td> <input type=\"text\" name=\"email\" size=\"20\"></td>\n");
94 fputs($feedbackform,"</tr><tr>\n");
95 fputs($feedbackform,"<td>City </td><td> <input type=\"text\" name=\"city\" size=\"15\"></td>\n");
96 fputs($feedbackform,"</tr><tr>\n");
97 fputs($feedbackform,"<td>State </td><td> <input type=\"text\" name=\"state\" size=\"2\"></td>\n");
98 fputs($feedbackform,"</tr><tr>\n");
99 fputs($feedbackform,"<td>ZIP/Postal Code </td><td> <input type=\"text\" name=\"zip\" size=\"5\"></td>\n");
100 fputs($feedbackform,"</tr><tr>\n");
101 fputs($feedbackform,"<td>Where did you find us?</td>\n");
102 fputs($feedbackform,"<td>\n");
103 fputs($feedbackform,"<select name=\"where\">\n");
104 fputs($feedbackform,"<option value=\"searchengine\" selected>Search Engine</option>\n");
105 fputs($feedbackform,"<option value=\"newsgroups\">UseNet</option>\n");
106 fputs($feedbackform,"<option value='freshmeat'>Freshmeat</option>\n");
107 fputs($feedbackform,"<option value='linuxapps'>Linux App</option>\n");
108 fputs($feedbackform,"</select>\n");
109 fputs($feedbackform,"</td>\n");
110 fputs($feedbackform,"</tr><tr>\n");
111 fputs($feedbackform,"<td>Did you find our site useful?</td>\n");
112 fputs($feedbackform,"<td><input type='radio' name='radio' value='yes' checked>Yes \n");
113 fputs($feedbackform,"<input type='radio' name='radio' value='no'>No\n");
114 fputs($feedbackform,"</td>\n");
115 fputs($feedbackform,"</tr><tr>\n");
116 fputs($feedbackform,"<th>\n");
117 fputs($feedbackform,"Comments</th>\n");
118 fputs($feedbackform,"</tr>\n");
119 fputs($feedbackform,"</table>\n");
120 fputs($feedbackform,"<table>\n");
121 fputs($feedbackform,"<tr>\n");
122 fputs($feedbackform,"<td>\n");
123 fputs($feedbackform,"<textarea name='comments' cols='55' rows='10'></textarea><br>\n");
124 fputs($feedbackform,"<input type='submit' name='submit' value='Submit'>\n");
125 fputs($feedbackform,"<input type='Reset' name='reset' value='Reset'>\n");
126 fputs($feedbackform,"</form>\n");
127 fputs($feedbackform,"</td>\n");
128 fputs($feedbackform,"</tr></table>\n");
129 fputs($feedbackform,"</center>\n");
130 fputs($feedbackform,"</td>\n");
131 fputs($feedbackform,"</tr>\n");
132 fputs($feedbackform,"</table>\n");
133 fputs($feedbackform,"</td>\n");
134 fputs($feedbackform,"</font> \n");
135 fputs($feedbackform,"</td></tr></table>\n");
136 fputs($feedbackform,"</font>\n");
137 fputs($feedbackform,"</td>\n");
138 fputs($feedbackform,"<td>\n");
139 fputs($feedbackform,"</td>\n");
140 fputs($feedbackform,"</tr>\n");
141 fputs($feedbackform,"</table>\n");
142 fputs($feedbackform,"</center>\n");
143 fputs($feedbackform,"<br>\n");
144 fputs($feedbackform,"<hr size=1 color=\"white\">\n");
145 fputs($feedbackform,"<font face=\"arial, heveltica\" size=2 style=\"font-size: 11; font-weight: normal;\">\n");
146 fputs($feedbackform,"<center>Best viewed using any browser <br>\n");
147 fputs($feedbackform,"<br><br>\n");
148 fputs($feedbackform,"<font face=\"arial, heveltica\" size=\"2\" color=\"Red\" style=\"font-size: 10; font-weight: normal;\">\n");
149 fputs($feedbackform,"<p align=\"center\">\n");
150 fputs($feedbackform,"The content of this web site is © 2000 - Your site.\n");
151 fputs($feedbackform,"</p>\n");
152 fputs($feedbackform,"</font>\n");
153 fputs($feedbackform,"</td>\n");
154 fputs($feedbackform,"</tr>\n");
155 fputs($feedbackform,"<tr>\n");
156 fputs($feedbackform,"</td>\n");
157 fputs($feedbackform,"</font> \n");
158 fputs($feedbackform,"</td></tr></table>\n");
159 fputs($feedbackform,"</font>\n");
160 fputs($feedbackform,"</td>\n");
161 fputs($feedbackform,"<td>\n");
162 fputs($feedbackform,"</td>\n");
163 fputs($feedbackform,"</tr>\n");
164 fputs($feedbackform,"</table>\n");
165 fputs($feedbackform,"</center>\n");
166 fputs($feedbackform,"<br>\n");
167 fputs($feedbackform,"</td>\n");
168 fputs($feedbackform,"</tr>\n");
169 fputs($feedbackform,"<tr>\n");
170 fputs($feedbackform,"<td colspan=2>\n");
171 fputs($feedbackform,"</td>\n");
172 fputs($feedbackform,"</td>\n");
173 fputs($feedbackform,"</tr>\n");
174 fputs($feedbackform,"</table>\n");
175 fputs($feedbackform,"</center>\n");
176 fputs($feedbackform,"</body>\n");
177 fputs($feedbackform,"</html>\n");
178 fclose($feedbackform);
179
180 /////////////////////////////////////////////////////////////////////////////// 181 // Create sendemail.php 182 // This script sends mail for feedback form 183 // no need to modify unless you like hacking 184 // bugs report to cthorn 185 /////////////////////////////////////////////////////////////////////////////// 186
187
188 $sendmail_filename="sendmail.php";
189
190 $sendmail = fopen($appfiledir . $sendmail_filename,"w");
191 fputs($sendmail,"<?php\n//** Generated by PCCS-MyAppGen $today\n");
192 fputs($sendmail,"/////////////////////////////////////////////////////////////////////////////////////\n");
193 fputs($sendmail,"// coder: cthorn\n");
194 fputs($sendmail,"////////////////////////////////////////////////////////////////////////////\n");
195 fputs($sendmail,"\n");
196 fputs($sendmail,"\$ip = \$REMOTE_ADDR;\n");
197 fputs($sendmail,"\$browser = \$HTTP_USER_AGENT;\n");
198 fputs($sendmail,"\n");
199 fputs($sendmail,"\$to = \"$useremail\";\n");
200 fputs($sendmail,"\$subject = \"FEEDBACK from Your Site\";\n");
201 fputs($sendmail,"\$message = \"\tWeb User: \$name submitted feedback\\n\\n\";\n");
202 fputs($sendmail,"\$message .= \" They found your site by using \" . \$where . \"\\n\";\n");
203 fputs($sendmail,"\$message .= \" They where using: \" . \$browser . \"\\n\";\n");
204 fputs($sendmail,"\$message .= \" Coming from: \" . \$ip . \"\\n\";\n");
205 fputs($sendmail,"\$message .= \"If they entered it there Address Info is \n\";\n");
206 fputs($sendmail,"\$message .= \$address . \"\\t\" . \$city . \"\\t\" . \$zip . \"\\n\\n\";\n");
207 fputs($sendmail,"\$message .= \" Did they find the site useful?\t \" . \$radio . \"\\n\";\n");
208 fputs($sendmail,"\$message .= \" Their comments\\n\\n\" . \$comments . \"\\n\";\n");
209 fputs($sendmail,"mail(\"\$to\",\"\$subject\",\"\$message\",\"From:\$email\\nReply-To: \$email\");\n");
210 fputs($sendmail," header(\"Location: ./thankyou.php\");\n");
211 fputs($sendmail,"\n");
212 fputs($sendmail,"//\n");
213 fputs($sendmail,"//\n");
214 fputs($sendmail,"//////////////////////////////////////////////////////////////////////////\n");
215 fputs($sendmail,"?>\n");
216 fclose($sendmail);
217
218 /////////////////////////////////////////////////////////////////////////////// 219 // Create thankyou.php 220 // redirected to this file via sendemail.php 221 // no need to modify unless you like hacking 222 // bugs report to cthorn 223 /////////////////////////////////////////////////////////////////////////////// 224
225 $thankyou_filename="thankyou.php";
226
227 $thankyou = fopen($appfiledir . $thankyou_filename,"w");
228 fputs($thankyou,"<?php\n//** Generated by PCCS-MyAppGen $today\n");
229 fputs($thankyou,"/////////////////////////////////////////////////////////////////////////////////////\n");
230 fputs($thankyou,"// coder: cthorn\n");
231 fputs($thankyou,"////////////////////////////////////////////////////////////////////////////\n");
232 fputs($thankyou,"\n");
233 fputs($thankyou,"echo \"Thank You for your FeedBack<br>\";\n");
234 fputs($thankyou,"echo \"Return to <a href=./>Your Site</a>\";\n");
235 fputs($thankyou,"//\n");
236 fputs($thankyou,"//\n");
237 fputs($thankyou,"//////////////////////////////////////////////////////////////////////////\n");
238 fputs($thankyou,"?>\n");
239 fclose($thankyou);
240
241
242
243 ?>
| |