Guest User

Untitled

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