PHP site 2 5/1/2017


SUBMITTED BY: canonical

DATE: May 2, 2017, 1:02 a.m.

FORMAT: PHP

SIZE: 22.0 kB

HITS: 284

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

comments powered by Disqus