View


sample.php
1// **********************************************************
2//
3// Display and process a simple form
4//
5// **********************************************************
6 
7require('functions.php');
8CheckLoggedIn();
9require('header.php');
10 
11// ********************************************************
12 
13function DisplayJavaScript()
14{
1<script type="text/javascript">
1 
2 function apopupwindow(url,title)
3 {
4 window.open(url,title,"width=420,height=400,resizable=yes,scrollbars=yes");
5 return false;
6 }
7 
8 function toggle_adv(tag)
9 {
10 var adv = document.getElementById('i-' + tag + '-adv-div')
11 var city = document.getElementById('i-' + tag + '-city')
12 var cities = document.getElementById('i-' + tag + '-city-pick-1')
13 var state = document.getElementById('i-' + tag + '-state')
14 var zone = document.getElementById('i-' + tag + '-zone')
15 var count = 2;
16 
17 if (adv.style.display != 'block')
18 {
19 city.disabled = true
20 state.disabled = true
21 zone.disabled = true
22 adv.style.display = 'block'
23 
24 while(cities)
25 {
26 cities.disabled = true
27 cities = document.getElementById('i-' + tag + '-city-pick-' + count)
28 count ++
29 }
30 }
31 else
32 {
33 city.disabled = false
34 state.disabled = false
35 zone.disabled = false
36 adv.style.display = 'none'
37 
38 while(cities)
39 {
40 cities.disabled = false
41 cities = document.getElementById('i-' + tag + '-city-pick-' + count)
42 count++
43 }
44 }
45 return true;
46 }
47 
2</script>
15}
16 
17// *************************************************************
18 
19if (isset($_POST))
20{
21 $output = open_results();
22 
23 write($output,"name:' . $_POST['name']);
24 write($output,"email" . $_POST['email']);
25 
26 // ...
27 
3<div class="content">
4<p>
1Thank you.
5</p>
6</div>
28}
29else
30{
31 DisplayJavaScript();
7<div class="content">
8<p>
2We need some information from you before we can proceed. Please fill
3out the following form and submit it. We'll be getting back to you
4soon enough.
9</p>
10<form id="Subscribe" method="post" action="sample.php" accept-charset="US-ASCII">
11<fieldset id="subinfo">
12<legend>
5Subscription Information
13</legend>
14<p>
15<label for="i-name">
6Name
16</label>
17<input id="i-name" title="Name" type="text" name="name" value="your name" tabindex="1">
18<br>
19<label for="i-email">
7Email
20</label>
21<input id="i-email" title="Email" type="text" name="email" value="you@example.com" tabindex="2">
22</p>
23<p>
24<label for="i-passwd-a">
8Password
25</label>
26<input id="i-passwd-a" name="passwd.a" type="password" tabindex="3">
27<br>
28<label for="i-passwd-b">
9(again)
29</label>
30<input id="i-passwd-b" name="passwd.b" type="password" tabindex="4">
31</p>
32</fieldset>
33<fieldset id="birthchart">
34<legend>
10Information for the Birth Chart
35</legend>
36<p>
37<label for="i-bd-month">
11Birth date
38</label>
39<select id="i-bd-month" name="bd.month" tabindex="5">
40<option value="1">
12January
41</option>
42<option value="2">
13February
43</option>
44<option value="3">
14March
45</option>
46<option value="4">
15April
47</option>
48<option value="5">
16May
49</option>
50<option value="6">
17June
51</option>
52<option value="7">
18July
53</option>
54<option value="8">
19August
55</option>
56<option value="9">
20September
57</option>
58<option value="10">
21October
59</option>
60<option value="11">
22November
61</option>
62<option value="12">
23December
63</option>
64</select>
65<input id="i-bd-day" type="text" name="bd.day" value="1" tabindex="6" size="2" maxsize="2">
66<input id="i-bd-year" type="text" name="bd.year" value="19--" tabindex="7" size="4" maxsize="4">
67</p>
68<p>
69<label for="i-bd-hour">
24Birth time
70</label>
71<input id="i-bd-hour" name="bd.hour" type="text" value="1" size="2" maxsize="2" tabindex="8">
25:
72<input id="i-bd-minute" name="bd.minute" type="text" value="01" size="2" maxsize="2" tabindex="9">
73<input id="i-bd-am" name="bd.ap" type="radio" value="am" checked="checked" tabindex="10">
74<label for="i-bd-am">
26AM
75</label>
76<input id="i-bd-pm" name="bd.ap" type="radio" value="pm" tabindex="11">
77<label for="i-bd-pm">
27PM
78</label>
79<input id="i-bd-dst" name="bd.dst" type="checkbox" value="true" tabindex="12">
80<label for="i-bd-dst">
81<a href="notes/dst.html" onclick='return apopupwindow("notes/dst.note.html","Daylight Saving Time")'>
28Daylight Saving Time
82</a>
83</label>
84</p>
85<p>
86<label for="i-bd-city">
29Birth city
87</label>
88<input id="i-bd-city" name="bd.city" type="text" value="Hueytown" tabindex="13">
89<select id="i-bd-state" name="bd.state" tabindex="14">
90<option value='AL'>
30Alabama
91</option>
92<option value='AK'>
31Alaska
93</option>
94<option value='AZ'>
32Arizona
95</option>
96<option value='AR'>
33Arkansas
97</option>
98<option value='CA'>
34California
99</option>
100<option value='CO'>
35Colorado
101</option>
102<option value='CT'>
36Connecticut
103</option>
104<option value='DE'>
37Delaware
105</option>
106<option value='FL'>
38Florida
107</option>
108<option value='GA'>
39Georgia
109</option>
110<option value='HI'>
40Hawaii
111</option>
112<option value='ID'>
41Idaho
113</option>
114<option value='IL'>
42Illinois
115</option>
116<option value='IN'>
43Indiana
117</option>
118<option value='IA'>
44Iowa
119</option>
120<option value='KS'>
45Kansas
121</option>
122<option value='KY'>
46Kentucky
123</option>
124<option value='LA'>
47Louisiana
125</option>
126<option value='ME'>
48Maine
127</option>
128<option value='MD'>
49Maryland
129</option>
130<option value='MA'>
50Massachusetts
131</option>
132<option value='MI'>
51Michigan
133</option>
134<option value='MN'>
52Minnesota
135</option>
136<option value='MS'>
53Mississippi
137</option>
138<option value='MO'>
54Missouri
139</option>
140<option value='MT'>
55Montana
141</option>
142<option value='NE'>
56Nebraska
143</option>
144<option value='NV'>
57Nevada
145</option>
146<option value='NH'>
58New Hampshire
147</option>
148<option value='NJ'>
59New Jersey
149</option>
150<option value='NM'>
60New Mexico
151</option>
152<option value='NY'>
61New York
153</option>
154<option value='NC'>
62North Carolina
155</option>
156<option value='ND'>
63North Dakota
157</option>
158<option value='OH'>
64Ohio
159</option>
160<option value='OK'>
65Oklahoma
161</option>
162<option value='OR'>
66Oregon
163</option>
164<option value='PA'>
67Pennsylvania
165</option>
166<option value='RI'>
68Rhode Island
167</option>
168<option value='SC'>
69South Carolina
169</option>
170<option value='SD'>
70South Dakota
171</option>
172<option value='TN'>
71Tennessee
173</option>
174<option value='TX'>
72Texas
175</option>
176<option value='UT'>
73Utah
177</option>
178<option value='VT'>
74Vermont
179</option>
180<option value='VA'>
75Virginia
181</option>
182<option value='WA'>
76Washington
183</option>
184<option value='DC'>
77Washington, DC
185</option>
186<option value='WV'>
78West Virginia
187</option>
188<option value='WI'>
79Wisconsin
189</option>
190<option value='WY'>
80Wyoming
191</option>
192</select>
193</p>
194<p>
195<label for="i-bd-zone">
81Time Zone
196</label>
197<select id="i-bd-zone" name="bd.zone" tabindex="15">
198<option value="-5:00">
82Eastern
199</option>
200<option value="-6:00">
83Central
201</option>
202<option value="-7:00">
84Mountain
203</option>
204<option value="-8:00">
85Pacific
205</option>
206<option value="-9:00">
86Alaska
207</option>
208<option value="-10:00">
87Hawaii-Aleutian
209</option>
210</select>
211<input id="i-bd-adv" name="bd.adv" type="checkbox" value="true" onclick='return toggle_adv("bd")' tabindex="16">
212<label for="i-bd-adv">
88Advanced
213</label>
214</p>
215<div class="adv" id="i-bd-adv-div">
216<p>
89Information here overrides the location given above.
217</p>
218<p>
219<label for="i-bd-lat-deg">
90Latitude
220</label>
221<input id="i-bd-lat-deg" name="bd.lat.deg" type="text" value="33" size="2" maxsize="2" tabindex="17">
91°
222<input id="i-bd-lat-min" name="bd.lat.min" type="text" value="26" size="2" maxsize="2" tabindex="18">
92
223<input id="i-bd-lat-sec" name="bd.lat.sec" type="text" value="15" size="2" maxsize="2" tabindex="19">
93
224<select id="i-bd-lat-hem" name="bd.lat.hem" tabindex="20">
225<option>
94N
226</option>
227<option>
95S
228</option>
229</select>
230</p>
231<p>
232<label for="i-bd-long-deg">
96Longitude
233</label>
234<input id="i-bd-long-deg" name="bd.long.deg" type="text" value="86" size="2" maxsize="2" tabindex="21">
97°
235<input id="i-bd-long-min" name="bd.long.min" type="text" value="59" size="2" maxsize="2" tabindex="22">
98
236<input id="i-bd-long-sec" name="bd.long.sec" type="text" value="51" size="2" maxsize="2" tabindex="23">
99
237<select id="i-bd-long-hem" name="bd.long.hem" tabindex="24">
238<option>
100E
239</option>
240<option selected="selected">
101W
241</option>
242</select>
243</p>
244<p>
245<label for="i-bd-zone-hour">
102Time Zone
246</label>
247<input id="i-bd-zone-hour" name="bd.zone.hour" type="text" value="-5" size="3" maxsize="3" tabindex="25">
103:
248<input id="i-bd-zone-min" name="bd.zone.min" type="text" value="00" size="2" maxsize="2" tabindex="26">
249</p>
250</div>
251</fieldset>
252<fieldset id="location">
253<legend>
104Information on your current Location
254</legend>
255<p>
256<label for="i-loc-city">
105Current city
257</label>
258<input id="i-loc-city" name="loc.city" type="text" value="Hueytown" tabindex="27">
259<select id="i-loc-state" name="loc.state" tabindex="28">
260<option value='AL'>
106Alabama
261</option>
262<option value='AK'>
107Alaska
263</option>
264<option value='AZ'>
108Arizona
265</option>
266<option value='AR'>
109Arkansas
267</option>
268<option value='CA'>
110California
269</option>
270<option value='CO'>
111Colorado
271</option>
272<option value='CT'>
112Connecticut
273</option>
274<option value='DE'>
113Delaware
275</option>
276<option value='FL'>
114Florida
277</option>
278<option value='GA'>
115Georgia
279</option>
280<option value='HI'>
116Hawaii
281</option>
282<option value='ID'>
117Idaho
283</option>
284<option value='IL'>
118Illinois
285</option>
286<option value='IN'>
119Indiana
287</option>
288<option value='IA'>
120Iowa
289</option>
290<option value='KS'>
121Kansas
291</option>
292<option value='KY'>
122Kentucky
293</option>
294<option value='LA'>
123Louisiana
295</option>
296<option value='ME'>
124Maine
297</option>
298<option value='MD'>
125Maryland
299</option>
300<option value='MA'>
126Massachusetts
301</option>
302<option value='MI'>
127Michigan
303</option>
304<option value='MN'>
128Minnesota
305</option>
306<option value='MS'>
129Mississippi
307</option>
308<option value='MO'>
130Missouri
309</option>
310<option value='MT'>
131Montana
311</option>
312<option value='NE'>
132Nebraska
313</option>
314<option value='NV'>
133Nevada
315</option>
316<option value='NH'>
134New Hampshire
317</option>
318<option value='NJ'>
135New Jersey
319</option>
320<option value='NM'>
136New Mexico
321</option>
322<option value='NY'>
137New York
323</option>
324<option value='NC'>
138North Carolina
325</option>
326<option value='ND'>
139North Dakota
327</option>
328<option value='OH'>
140Ohio
329</option>
330<option value='OK'>
141Oklahoma
331</option>
332<option value='OR'>
142Oregon
333</option>
334<option value='PA'>
143Pennsylvania
335</option>
336<option value='RI'>
144Rhode Island
337</option>
338<option value='SC'>
145South Carolina
339</option>
340<option value='SD'>
146South Dakota
341</option>
342<option value='TN'>
147Tennessee
343</option>
344<option value='TX'>
148Texas
345</option>
346<option value='UT'>
149Utah
347</option>
348<option value='VT'>
150Vermont
349</option>
350<option value='VA'>
151Virginia
351</option>
352<option value='WA'>
152Washington
353</option>
354<option value='DC'>
153Washington, DC
355</option>
356<option value='WV'>
154West Virginia
357</option>
358<option value='WI'>
155Wisconsin
359</option>
360<option value='WY'>
156Wyoming
361</option>
362</select>
363</p>
364<p>
365<label for="i-loc-zone">
157Time Zone
366</label>
367<select id="i-loc-zone" name="loc.zone" tabindex="29">
368<option value="-5:00">
158Eastern
369</option>
370<option value="-6:00">
159Central
371</option>
372<option value="-7:00">
160Mountain
373</option>
374<option value="-8:00">
161Pacific
375</option>
376<option value="-9:00">
162Alaska
377</option>
378<option value="-10:00">
163Hawaii-Aleutian
379</option>
380</select>
381<input id="i-loc-adv" name="loc.adv" type="checkbox" onclick="return toggle_adv('loc')" value="true" tabindex="30">
382<label for="i-loc-adv">
164Advanced
383</label>
384</p>
385<div class="adv" id="i-loc-adv-div">
386<p>
165Information here overrides the location given above.
387</p>
388<p>
389<label for="i-loc-lat-deg">
166Latitude
390</label>
391<input id="i-loc-lat-deg" name="loc.lat.deg" type="text" value="33" size="2" maxsize="2" tabindex="31">
167°
392<input id="i-loc-lat-min" name="loc.lat.min" type="text" value="26" size="2" maxsize="2" tabindex="32">
168
393<input id="i-loc-lat-sec" name="loc.lat.sec" type="text" value="15" size="2" maxsize="2" tabindex="33">
169
394<select id="i-loc-lat-hem" name="loc.lat.hem" tabindex="34">
395<option>
170N
396</option>
397<option>
171S
398</option>
399</select>
400</p>
401<p>
402<label for="i-loc-long-deg">
172Longitude
403</label>
404<input id="i-loc-long-deg" name="loc.long.deg" type="text" value="86" size="2" maxsize="2" tabindex="35">
173°
405<input id="i-loc-long-min" name="loc.long.min" type="text" value="59" size="2" maxsize="2" tabindex="36">
174
406<input id="i-loc-long-sec" name="loc.long.sec" type="text" value="51" size="2" maxsize="2" tabindex="37">
175
407<select id="i-loc-long-hem" name="loc.long.hem" tabindex="38">
408<option>
176E
409</option>
410<option selected="selected">
177W
411</option>
412</select>
413</p>
414<p>
415<label for="i-loc-zone-hour">
178Time Zone
416</label>
417<input id="i-loc-zone-hour" name="loc.zone.hour" type="text" value="-5" size="3" maxsize="3" tabindex="39">
179:
418<input id="i-loc-zone-min" name="loc.zone.min" type="text" value="00" size="2" maxsize="2" tabindex="40">
419</p>
420</div>
421</fieldset>
422<fieldset id="control">
423<legend>
180Subscribe
424</legend>
425<p style="text-align: center;">
426<input id="i-submit" type="submit" name="submit" value="Subscribe" tabindex="41">
427<input id="i-reset" type="reset" name="reset" value="Reset" tabindex="42">
428</p>
429</fieldset>
430</form>
431</div>
32}
33 
34require('footer.php');
35