Advertisement
Guest User

Untitled

a guest
Apr 6th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.13 KB | None | 0 0
  1.  
  2.  
  3. <?php
  4.  
  5. include 'customfunctions.php';
  6. include 'dblogin.php';
  7. ini_set('display_startup_errors', 1);
  8. //ini_set('display_errors', 'On');
  9. error_reporting(E_ALL);
  10.  
  11. $claimcode = $_GET["claimcode"];
  12.  
  13. $mysql_array = dbloginreturn();
  14. $host = $mysql_array['host'];
  15. $login = $mysql_array['login'];
  16. $password = $mysql_array['password'];
  17. $database = $mysql_array['database'];
  18.  
  19. $link = mysql_connect($host, $login, $password) or die(mysql_error());
  20. mysql_select_db($database) or die(mysql_error());
  21. $display = mysql_query("select * from prizes where claimcode=$claimcode") or die(mysql_error());
  22. $n = 1;
  23. $prints = 0;
  24. $posters = 0;
  25. while($n1=mysql_fetch_array($display)) {
  26. if ($n == 1) {
  27. $user = $n1[user];
  28. print "Congrationals $user on your prize winninsg!<br>
  29. You have won:<br>";
  30. }
  31. $n++;
  32. //print "$n1[user]<br>";
  33. $user = $n1[user];
  34. $prize = translation2($n1[prize]);
  35.  
  36. //once it's updated with prizes 101-103 i can set $printcountorsomething to sql fetch of
  37.  
  38. if ($n1[prize] == 5) { $postcards = $postcards + 1; }
  39. if ($n1[prize] == 12) { $postcards = $postcards + 1; }
  40. if ($n1[prize] == 13) { $prints = $prints + 1; }
  41. if ($n1[prize] == 15) { $prints = $prints + 1; }
  42. if ($n1[prize] == 19) { $prints = $prints + 5; } //Propogate the database with more individual 8.5x11's
  43. //might want to have a function that replaces prize numbers with a resolved 101 prize of 4x6 and resolved 102 prize of 8.5x11 and have one line in prizes for each attached to the claimcode
  44. if ($n1[prize] == 21) { $prints = $prints + 5; }
  45. if ($n1[prize] == 25) { $prints = $prints + 2; }
  46. if ($n1[prize] == 26) { $prints = $prints + 10; }
  47. if ($n1[prize] == 32) { $prints = $prints + 1; }
  48. if ($n1[prize] == 37) { $prints = $prints + 1; }
  49. if ($n1[prize] == 22) { $posters = $posters + 1; }
  50. if ($n1[prize] == 29) { $posters = $posters + 3; }
  51. print "$prize";
  52. print "<br>";
  53. }
  54.  
  55.  
  56. //var_dump($_POST);
  57. //quick little function to parse through the posted prints
  58.  
  59.  
  60.  
  61.  
  62.  
  63. $fname = $_POST['FName'];
  64. $lname = $_POST['LName'];
  65. $paint = $_POST['Paint'];
  66. $signed = $_POST['Signed'];
  67. $address1 = $_POST['Address1'];
  68. $address2 = $_POST['Address2'];
  69. $city = $_POST['City'];
  70. $country = $_POST['country'];
  71. $province = $_POST['province'];
  72. $state = $_POST['state'];
  73. $othercountry = $_POST['othercountry'];
  74. $otherstate = $_POST['otherstate'];
  75. $zip = $_POST['Zip'];
  76.  
  77.  
  78. if ($country == "Canada") {
  79. $canada = "selected=yes";
  80. if ($province) {
  81. if ($province == "BC") { $bc = "selected=yes"; }
  82. if ($province == "AB") { $ab = "selected=yes"; }
  83. if ($province == "SK") { $sk = "selected=yes"; }
  84. if ($province == "MB") { $mb = "selected=yes"; }
  85. if ($province == "ON") { $on = "selected=yes"; }
  86. if ($province == "QB") { $qb = "selected=yes"; }
  87. if ($province == "NL") { $nl = "selected=yes"; }
  88. if ($province == "NB") { $nb = "selected=yes"; }
  89. if ($province == "NS") { $ns = "selected=yes"; }
  90. if ($province == "PE") { $pe = "selected=yes"; }
  91. if ($province == "YK") { $yk = "selected=yes"; }
  92. if ($province == "NV") { $nv = "selected=yes"; }
  93. if ($province == "NT") { $nt = "selected=yes"; }
  94. }
  95. }
  96. elseif ($country == "US") {
  97. $us = "selected=yes";
  98. if ($state) {
  99. if ($state == "AK") { $ak = "selected=yes"; }
  100. if ($state == "AR") { $ar = "selected=yes"; }
  101. if ($state == "AL") { $al = "selected=yes"; }
  102. if ($state == "AZ") { $az = "selected=yes"; }
  103. if ($state == "CA") { $ca = "selected=yes"; }
  104. if ($state == "CO") { $co = "selected=yes"; }
  105. if ($state == "CT") { $ct = "selected=yes"; }
  106. if ($state == "DE") { $de = "selected=yes"; }
  107. if ($state == "FL") { $fl = "selected=yes"; }
  108. if ($state == "GA") { $ga = "selected=yes"; }
  109. if ($state == "HI") { $hi = "selected=yes"; }
  110. if ($state == "IA") { $ia = "selected=yes"; }
  111. if ($state == "ID") { $id = "selected=yes"; }
  112. if ($state == "IL") { $il = "selected=yes"; }
  113. if ($state == "IN") { $in = "selected=yes"; }
  114. if ($state == "KS") { $ks = "selected=yes"; }
  115. if ($state == "KY") { $ky = "selected=yes"; }
  116. if ($state == "LA") { $la = "selected=yes"; }
  117. if ($state == "MA") { $ma = "selected=yes"; }
  118. if ($state == "MD") { $md = "selected=yes"; }
  119. if ($state == "ME") { $me = "selected=yes"; }
  120. if ($state == "MI") { $mi = "selected=yes"; }
  121. if ($state == "MN") { $mn = "selected=yes"; }
  122. if ($state == "MO") { $mo = "selected=yes"; }
  123. if ($state == "MS") { $ms = "selected=yes"; }
  124. if ($state == "MT") { $mt = "selected=yes"; }
  125. if ($state == "NC") { $nc = "selected=yes"; }
  126. if ($state == "ND") { $nd = "selected=yes"; }
  127. if ($state == "NE") { $ne = "selected=yes"; }
  128. if ($state == "NH") { $nh = "selected=yes"; }
  129. if ($state == "NJ") { $nj = "selected=yes"; }
  130. if ($state == "NM") { $nm = "selected=yes"; }
  131. if ($state == "NV") { $nv = "selected=yes"; }
  132. if ($state == "NY") { $ny = "selected=yes"; }
  133. if ($state == "OH") { $oh = "selected=yes"; }
  134. if ($state == "OK") { $ok = "selected=yes"; }
  135. if ($state == "OR") { $or = "selected=yes"; }
  136. if ($state == "PA") { $pa = "selected=yes"; }
  137. if ($state == "RI") { $ri = "selected=yes"; }
  138. if ($state == "SC") { $sc = "selected=yes"; }
  139. if ($state == "SD") { $sd = "selected=yes"; }
  140. if ($state == "TN") { $tn = "selected=yes"; }
  141. if ($state == "TX") { $tx = "selected=yes"; }
  142. if ($state == "UT") { $ut = "selected=yes"; }
  143. if ($state == "VA") { $va = "selected=yes"; }
  144. if ($state == "VT") { $vt = "selected=yes"; }
  145. if ($state == "WA") { $wa = "selected=yes"; }
  146. if ($state == "WI") { $wi = "selected=yes"; }
  147. if ($state == "WV") { $wv = "selected=yes"; }
  148. if ($state == "WY") { $wy = "selected=yes"; }
  149. if ($state == "AS") { $as = "selected=yes"; }
  150. if ($state == "DC") { $dc = "selected=yes"; }
  151. if ($state == "GU") { $gu = "selected=yes"; }
  152. if ($state == "MP") { $mp = "selected=yes"; }
  153. if ($state == "PR") { $pr = "selected=yes"; }
  154. if ($state == "VI") { $vi = "selected=yes"; }
  155. }
  156. }
  157. elseif ($country == "Other") { $other = "selected=yes"; }
  158. else { $country = "Canada"; $canada = "selected=yes"; $province_not_selected = "selected=yes"; }
  159.  
  160. if
  161. (isset($_REQUEST['submitted'])) {
  162. // Initialize error array.
  163. $errors = array();
  164. // Check for a proper First name
  165. if (!empty($_REQUEST['FName'])) {
  166. $FName = $_REQUEST['FName'];
  167. $pattern = "/^[a-zA-Z]{2,20}/";
  168. if (preg_match($pattern,$FName)){ $FName = $_REQUEST['FName'];}
  169. else{ $errors[] = 'Your First name can only contain A-Z or a-z and be 2-20 characters long.';}
  170. } else {$errors[] = 'You forgot to enter your First Name.';}
  171. // Check for a proper Last name
  172. if (!empty($_REQUEST['LName'])) {
  173. $LName = $_REQUEST['LName'];
  174. $pattern = "/^[a-zA-Z]{1,30}/";
  175. if (preg_match($pattern,$LName)){ $LName = $_REQUEST['LName'];}
  176. else{ $errors[] = 'Your Last name can only contain A-Z or a-z and be 1-20 characters long.';}
  177. } else {$errors[] = 'You forgot to enter your Last Name.';}
  178.  
  179. //Address
  180. if (!empty($_REQUEST['Address1'])) {
  181. $Address1 = $_REQUEST['Address1'];
  182. $pattern = "/^[a-zA-Z0-9\_]{1,100}/";
  183. if (preg_match($pattern,$Address1)){ $Address1 =
  184. $_REQUEST['Address1'];}
  185. else{ $errors[] = 'Your Address 1 can only contain _, 1-9, A-Z or a-z 1-100
  186. long.';}
  187. } else {$errors[] = 'You forgot your Address 1.';}
  188. //Address 2
  189. if (!empty($_REQUEST['Address2'])) {
  190. $Address2 = $_REQUEST['Address2'];
  191. $pattern = "/^[a-zA-Z0-9\_]{1,100}/";
  192. if (preg_match($pattern,$Address2)){ $Address2 = $_REQUEST['Address2'];}
  193. else{ $errors[] = 'Your Address 2 can only contain _, 1-9, A-Z or a-z
  194. 2-100 long.';}
  195. }
  196. //Signed too
  197. if (!empty($_REQUEST['Signed'])) {
  198. $Signed = $_REQUEST['Signed'];
  199. } else {
  200. $Signed = $FName;
  201. }
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. function checkPaint($checktype) {
  209. $z = 1;
  210. $errors = array();
  211. while (isset($_REQUEST["{$checktype}{$z}"])) {
  212. print_r($_REQUEST);
  213. print "REQUEST: " . $_REQUEST["{$checktype}{$z}"] . "<BR>";
  214. if ($_REQUEST["{$checktype}{$z}"] == "-CHOOSE YOUR PAINT-") { $errors[] = "You forgot your $z $checktype";}
  215. elseif ($_REQUEST["{$checktype}{$z}"] == "-") { $errors[] = "You forgot your $z $checktype";}
  216. $z++;
  217. }
  218. print "Errors: ";
  219. var_dump($errors);
  220. return $errors;
  221.  
  222. }
  223. $errors = array_merge($errors, checkPaint('Postcards'));
  224. $errors = array_merge($errors, checkPaint('Prints'));
  225. $errors = array_merge($errors, checkPaint('Posters'));
  226. // print "<br><br>";
  227. // var_dump($errors);
  228.  
  229.  
  230. //CITY
  231. if (!empty($_REQUEST['City'])) {
  232. $City = $_REQUEST['City'];
  233. $pattern = "/^[a-zA-Z0-9\_]{1,100}/";
  234. if (preg_match($pattern,$City)){ $City = $_REQUEST['City'];}
  235. else{ $errors[] = 'Your City can only contain _, 1-9, A-Z or a-z 2-100 long.';}
  236. } else {$errors[] = 'You forgot your City.';}
  237. //STATE
  238. if ($country == "US" && empty($_REQUEST['state'])) {
  239. $errors[] = 'You forgot your State.';
  240. }
  241. //PROVINCE
  242. if ($country == "Canada" && empty($_REQUEST['province'])) {
  243. $errors[] = 'You forgot your Province.';
  244. }
  245. //COUNTRY
  246. if (($country == "Other") && (!empty($_REQUEST['othercountry']))) {
  247. $othercountry = $_REQUEST['othercountry'];
  248. $pattern = "/^[a-zA-Z0-9\_]{2,100}/";
  249. if (preg_match($pattern,$othercountry)){ $othercountry = $_REQUEST['othercountry'];}
  250. else{ $errors[] = 'Your Country can only contain _, 1-9, A-Z or a-z
  251. 2-100 long.';}
  252. } elseif ($country == "Other") {$errors[] = 'You forgot your Country.';}
  253. //ZIP/POSTAL
  254. if (!empty($_REQUEST['Zip'])) {
  255. $Zip = $_REQUEST['Zip'];
  256. $pattern = "/^[a-zA-Z0-9\_]{2,100}/";
  257. if (preg_match($pattern,$Zip)){ $Zip = $_REQUEST['Zip'];}
  258. else{ $errors[] = 'Your Zip/Postal can only contain _, 1-9, A-Z or a-z
  259. 2-100 long.';}
  260. } else {$errors[] = 'You forgot your Zip/Postal.';}
  261. }
  262. //End of validation
  263. /*
  264. *
  265. * MOOOOOOOOOOSSSSSEEEEEEEE HERE!!!!!!!!!!!!!!!!!
  266. *
  267. */
  268.  
  269.  
  270.  
  271. if (isset($_REQUEST['submitted'])) {
  272. if (empty($errors)) {
  273.  
  274. $myfile = fopen("Mailing.txt", "a");
  275. $nwln = "\r\n";
  276. $com = ", ";
  277. fwrite ($myfile, "$user - ");
  278. fwrite ($myfile, $Paint);
  279. fwrite ($myfile, "Signed to - $Signed");
  280. fwrite ($myfile, $nwln);
  281. fwrite ($myfile, $nwln);
  282.  
  283. fwrite ($myfile, "$FName $LName");
  284. fwrite ($myfile, $nwln);
  285. fwrite ($myfile, $Address1);
  286. fwrite ($myfile, $nwln);
  287. if (!empty($Address2)) {
  288. fwrite ($myfile, $Address2);
  289. fwrite ($myfile, $nwln);
  290. }
  291. fwrite ($myfile, $City);
  292. fwrite ($myfile, $com);
  293. if (!empty($state)) {
  294. fwrite ($myfile, $state);
  295. fwrite ($myfile, $com);
  296. }
  297. if (!empty($province)) {
  298. fwrite ($myfile, $province);
  299. fwrite ($myfile, $com);
  300. }
  301. if (!empty($otherstate)) {
  302. fwrite ($myfile, $otherstate);
  303. fwrite ($myfile, $com);
  304. }
  305. if ($country == "US") { $country = "USA"; }
  306. if ($country == "Other") { $country = $othercountry; }
  307. fwrite ($myfile, $country);
  308.  
  309. fwrite ($myfile, $nwln);
  310. $Zip = strtoupper($Zip);
  311. fwrite ($myfile, $Zip);
  312. fwrite ($myfile, $nwln);
  313. fwrite ($myfile, $nwln);
  314. fwrite ($myfile, $nwln);
  315. fwrite ($myfile, $nwln);
  316.  
  317. $link = mysql_connect($host, $login, $password) or die(mysql_error());
  318. mysql_select_db($database) or die(mysql_error());
  319.  
  320.  
  321.  
  322. $provinceForTheDatabase = $province . $state . $otherstate;
  323.  
  324. mysql_query("REPLACE INTO addresses
  325. (user, firstname, lastname, addy1, addy2, city, province, country, zip)
  326. VALUES
  327. ('$user', '$FName', '$LName', '$Address1', '$Address2', '$City', '$provinceForTheDatabase', '$country', '$zip')") or die(mysql_error());
  328. mysql_close($link);
  329.  
  330.  
  331. //for moving prizes from prizes to prizes-claimed
  332. $link = mysql_connect($host, $login, $password) or die(mysql_error());
  333. mysql_select_db($database) or die(mysql_error());
  334. $prizes_to_move = mysql_query("select * from prizes where claimcode=$claimcode") or die(mysql_error());
  335. $print_number = 1;
  336. $postcards_number = 1;
  337. $posters_number = 1;
  338. while($n1=mysql_fetch_array($prizes_to_move)) {
  339. // print_r($n1);
  340. // print "<br>Translation:";
  341. // print translation2($n1[prize]);
  342. // print "<br>.<br>";
  343.  
  344. if (translation2($n1[prize]) == "4x6 Print") {
  345. $id = $n1[id];
  346. $prize = $n1[prize];
  347. $print_title = $_POST['Postcards' . $postcards_number];
  348. $sign_to = $_POST['Signed_Postcards_' . $postcards_number];
  349. if (!$sign_to) { $sign_to = $FName; }
  350. $ctime = $n1[ctime];
  351. print "<BR>4x6<br>INSERT INTO `prizes-claimed`
  352. (`user`, `prize`, `4x6`, `SignTo`, `ctime`, `claimcode`)
  353. VALUES
  354. ('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)";
  355. mysql_query("INSERT INTO `prizes-claimed`
  356. (`user`, `prize`, `4x6`, `SignTo`, `ctime`, `claimcode`)
  357. VALUES
  358. ('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
  359. mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
  360. $postcards_number++;
  361. }
  362. elseif ((translation2($n1[prize]) == "8.5x11 Print") || (translation2($n1[prize]) == "6 Months Print")) {
  363. $id = $n1[id];
  364. $prize = $n1[prize];
  365. $print_title = $_POST['Prints' . $print_number];
  366. $sign_to = $_POST['Signed_Prints_' . $print_number];
  367. if (!$sign_to) { $sign_to = $FName; }
  368. $ctime = $n1[ctime];
  369. /*
  370. print "<br>8.5x11<br>INSERT INTO `prizes-claimed`
  371. (`user`, `prize`, `8.5x11`, `SignTo`, `ctime`, `claimcode`)
  372. VALUES
  373. ('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)";
  374. */
  375. mysql_query("INSERT INTO `prizes-claimed`
  376. (`user`, `prize`, `8.5x11`, `SignTo`, `ctime`, `claimcode`)
  377. VALUES
  378. ('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
  379. mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
  380. $print_number++;
  381. }
  382. elseif (translation2($n1[prize]) == "12x18 Poster") {
  383. $id = $n1[id];
  384. $prize = $n1[prize];
  385. $print_title = $_POST['Posters' . $posters_number];
  386. $sign_to = $_POST['Signed_Posters_' . $posters_number];
  387. if (!$sign_to) { $sign_to = $FName; }
  388. $ctime = $n1[ctime];
  389.  
  390. mysql_query("INSERT INTO `prizes-claimed`
  391. (`user`, `prize`, `12x18`, `SignTo`, `ctime`, `claimcode`)
  392. VALUES
  393. ('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
  394. mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
  395. $posters_number++;
  396. }
  397. else {
  398. $id = $n1[id];
  399. $prize = $n1[prize];
  400. $ctime = $n1[ctime];
  401. mysql_query("INSERT INTO `prizes-claimed`
  402. (`user`, `prize`, `ctime`, `claimcode`)
  403. VALUES
  404. ('$user', '$prize', $ctime, $claimcode)") or die(mysql_error());
  405. mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
  406. }
  407. print "<br><br>";
  408. }
  409.  
  410.  
  411. }
  412. }
  413. /*
  414. *
  415. * END FORMATTING!!!!!!!!!!!!!!!!!
  416. *
  417. */
  418. ?>
  419. <?php
  420. //Print Errors
  421. if (isset($_REQUEST['submitted'])) {
  422. // Print any error messages.
  423. if (!empty($errors)) {
  424. echo '<hr /><h3>The following occurred:</h3><ul>';
  425. // Print each error.
  426. foreach ($errors as $msg) { echo '<li>'. $msg . '</li>';}
  427. echo '</ul><h3>Your Address could not be sent due to input errors.</h3><hr />';
  428. }
  429. else {
  430. echo '<hr /><h3 align="center">Your mail was sent. Thank you!</h3><hr />
  431. <p>If the information below is not correct, go back and send moose another whisper.</p>';
  432.  
  433. print ("$user <br /><br />");
  434.  
  435. print ("$FName $LName <br />");
  436. print ("$Address1 <br />");
  437. if (!empty($Address2)) {
  438. print ("$Address2 <br />");
  439. }
  440. print ($City);
  441. print ($com);
  442. if (!empty($state)) {
  443. print ($state);
  444. print ($com);
  445. }
  446. if (!empty($province)) {
  447. print ($province);
  448. print ($com);
  449. }
  450. if (!empty($otherstate)) {
  451. print ($otherstate);
  452. print ($com);
  453. }
  454. if ($country == "Other") { print "$othercountry <br>"; }
  455. else { print ("$country <br />"); }
  456. print ("$zip <br /> <br /> <br /> <br />");
  457. }
  458. }
  459.  
  460.  
  461. if (empty($errors) && isset($_REQUEST['submitted'])) { die(); }
  462.  
  463. //End of errors array
  464. print "
  465. <h1>
  466. Give Moose your info!
  467. </h1>
  468. <h2>
  469. This form is incompatible with some versions Safari</h2>
  470. If you're using safari, switch to a different browser.
  471. Otherwise don't sweat it.<br><br>
  472. <p>
  473. Fill out the form below to get your prize(s).
  474. </p>
  475. <form action=\"\" method=\"post\">
  476. <Br>
  477. <label>First Name: <br />
  478. <input name=\"FName\" type=\"text\" value=\"$fname\" /><br /></label>
  479. <label>Last Name: <br />
  480. <input name=\"LName\" type=\"text\" value=\"$lname\" /><br /></label>
  481.  
  482. <label>Address 1: <br />
  483. <input name=\"Address1\" type=\"text\" value=\"$address1\" /><br /></label>
  484. <label>Address 2: <br />
  485. <input name=\"Address2\" type=\"text\" value=\"$address2\" /><br /></label>
  486. <label>City: <br />
  487. <input name=\"City\" type=\"text\" value=\"$city\" /><br /></label>
  488. Country:
  489. <SELECT NAME=\"country\" onchange=\"this.form.submit()\">
  490. <OPTION VALUE=\"Canada\" $canada>Canada
  491. <OPTION VALUE=\"US\" $us>US
  492. <OPTION VALUE=\"Other\" $other>Other
  493. </SELECT><br>
  494. ";
  495.  
  496. if ($canada == "selected=yes") {
  497. print " Province
  498. <SELECT NAME=\"province\" onchange=\"this.form.submit()\">
  499. <OPTION VALUE=\"\" $province_not_selected>Select Province
  500. <OPTION VALUE=\"BC\" $bc>British Columbia
  501. <OPTION VALUE=\"AB\" $ab>Alberta
  502. <OPTION VALUE=\"SK\" $sk>Saskatchewan
  503. <OPTION VALUE=\"MB\" $mb>Manitoba
  504. <OPTION VALUE=\"ON\" $on>Ontario
  505. <OPTION VALUE=\"QB\" $qb>Quebec
  506. <OPTION VALUE=\"NL\" $nl>Newfoundland
  507. <OPTION VALUE=\"NB\" $nb>New Brunswick
  508. <OPTION VALUE=\"NS\" $ns>Nova Scotia
  509. <OPTION VALUE=\"PE\" $pe>P.E.I.
  510. <OPTION VALUE=\"YK\" $yk>YK
  511. <OPTION VALUE=\"NV\" $nv>Nunavut
  512. <OPTION VALUE=\"NT\" $nt>NW Territories
  513. </SELECT>
  514. <br>"; }
  515.  
  516. if ($us == "selected=yes") {
  517. print " State
  518. <SELECT NAME=\"state\" onchange=\"this.form.submit()\">
  519. <OPTION VALUE=\"\" $province_not_selected>Select State
  520. <OPTION VALUE=\"AK\" $ak>Alaska
  521. <OPTION VALUE=\"AL\" $al>Alabama
  522. <OPTION VALUE=\"AR\" $ar>Arkansas
  523. <OPTION VALUE=\"AZ\" $az>Arizona
  524. <OPTION VALUE=\"CA\" $ca>California
  525. <OPTION VALUE=\"CO\" $co>Colorado
  526. <OPTION VALUE=\"CT\" $ct>Connecticut
  527. <OPTION VALUE=\"DE\" $de>Delaware
  528. <OPTION VALUE=\"FL\" $fl>Florida
  529. <OPTION VALUE=\"GA\" $ga>Georgia
  530. <OPTION VALUE=\"HI\" $hi>Hawaii
  531. <OPTION VALUE=\"IA\" $ia>Iowa
  532. <OPTION VALUE=\"ID\" $id>Idaho
  533. <OPTION VALUE=\"IL\" $il>Illinois
  534. <OPTION VALUE=\"IN\" $in>Indiana
  535. <OPTION VALUE=\"KS\" $ks>Kansas
  536. <OPTION VALUE=\"KY\" $ky>Kentucky
  537. <OPTION VALUE=\"LA\" $la>Louisiana
  538. <OPTION VALUE=\"MA\" $ma>Massachusetts
  539. <OPTION VALUE=\"MD\" $md>Maryland
  540. <OPTION VALUE=\"ME\" $me>Maine
  541. <OPTION VALUE=\"MI\" $mi>Michigan
  542. <OPTION VALUE=\"MN\" $mn>Minnesota
  543. <OPTION VALUE=\"MO\" $mo>Missouri
  544. <OPTION VALUE=\"MS\" $ms>Mississippi
  545. <OPTION VALUE=\"MT\" $mt>Montana
  546. <OPTION VALUE=\"NC\" $nc>North Carolina
  547. <OPTION VALUE=\"ND\" $nd>North Dakota
  548. <OPTION VALUE=\"NE\" $ne>Nebraska
  549. <OPTION VALUE=\"NH\" $nh>New Hampshire
  550. <OPTION VALUE=\"NJ\" $nj>New Jersey
  551. <OPTION VALUE=\"NM\" $nm>New Mexico
  552. <OPTION VALUE=\"NV\" $nv>Nevada
  553. <OPTION VALUE=\"NY\" $ny>New York
  554. <OPTION VALUE=\"OH\" $oh>Ohio
  555. <OPTION VALUE=\"OK\" $ok>Oklahoma
  556. <OPTION VALUE=\"OR\" $or>Oregon
  557. <OPTION VALUE=\"PA\" $pa>Pennsylvania
  558. <OPTION VALUE=\"RI\" $ri>Rhode Island
  559. <OPTION VALUE=\"SC\" $sc>South Carolina
  560. <OPTION VALUE=\"SD\" $sd>South Dakota
  561. <OPTION VALUE=\"TN\" $tn>Tennessee
  562. <OPTION VALUE=\"TX\" $tx>Texas
  563. <OPTION VALUE=\"UT\" $ut>Utah
  564. <OPTION VALUE=\"VA\" $va>Virginia
  565. <OPTION VALUE=\"VT\" $vt>Vermont
  566. <OPTION VALUE=\"WA\" $wa>Washington
  567. <OPTION VALUE=\"WI\" $wi>Wisconsin
  568. <OPTION VALUE=\"WV\" $wv>West Virginia
  569. <OPTION VALUE=\"WY\" $wy>Wyoming
  570. <OPTION VALUE=\"AS\" $as>American Samoa
  571. <OPTION VALUE=\"DC\" $dc>District of Columbia
  572. <OPTION VALUE=\"GU\" $gu>Guam
  573. <OPTION VALUE=\"MP\" $mp>Mariana Islands
  574. <OPTION VALUE=\"PR\" $pr>Puerto Rico
  575. <OPTION VALUE=\"VI\" $vi>Virgin Islands
  576. </SELECT>
  577. <br>";
  578. }
  579.  
  580. if ($other == "selected=yes") {
  581. print "Country:
  582. <input name=\"othercountry\" type=\"text\" value=\"$othercountry\" /><br>";
  583. print "State/Province:
  584. <input name=\"otherstate\" type=\"text\" value=\"$otherstate\" /><br>";
  585. }
  586.  
  587. print "<label>zip/postal: <br />
  588. <input name=\"Zip\" type=\"text\" value=\"$zip\" /><br
  589. /></label>
  590. <br />
  591. <br />";
  592.  
  593.  
  594. //TURNOOFFF THIS HARDCODED $PRINTS
  595. //$prints = 3;
  596. //$posters = 3;
  597. //print " prints : $prints posters : $posters<br>";
  598.  
  599. $printscounter = 1;
  600. $postercounter = 1;
  601.  
  602.  
  603. function printDropdowns($type,$count,$dropdownprint) {
  604. for ($counter = 1; $counter <= $count; $counter++) {
  605. print " <label>Character $type $counter?<br />
  606. <select name=\"{$type}{$counter}\">";
  607.  
  608. print "$dropdownprint
  609. </select></label><br>
  610. <label>Signed To: <br />
  611. (If Left Blank Will Sign to First Name Provided) <br />
  612. <input name=\"Signed_{$type}_{$counter}\" type=\"text\" value=\"\" /><br /></label>";
  613. print "<br>
  614.  
  615.  
  616. ";
  617. }
  618. }
  619.  
  620. $dropdownprint = '';
  621. $lines = file('characters.txt');
  622. foreach($lines as $character) {
  623. $character = trim($character);
  624. $dropdownprint .= "<option value=\"" . $character . "\">" . $character . "</option>
  625. ";
  626. }
  627. if ($postcards > 0) {
  628. printDropdowns('Postcards',$postcards,$dropdownprint);
  629. }
  630.  
  631. if ($prints > 0) {
  632. printDropdowns('Prints',$prints,$dropdownprint);
  633. }
  634.  
  635. if ($posters > 0) {
  636. printDropdowns('Posters',$posters,$dropdownprint);
  637. }
  638.  
  639. print "
  640. <input name=\"submitted\" type=\"submit\" value=\"Submit\" />
  641. </form><br><br><br><br><br>
  642. Form contributed to by AlexaSimonSaysHello and Nemesis851 and Oewyn and mzcosty and typedefeX and Reecon820
  643. ";
  644.  
  645.  
  646. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement