Advertisement
Guest User

Untitled

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