If you want more of my pastes visit: https://randompaste.000webhostapp.com/index.html
--------------------------------------------------------------------------------------
<?php
include 'customfunctions.php';
include 'dblogin.php';
ini_set('display_startup_errors', 1);
//ini_set('display_errors', 'On');
error_reporting(E_ALL);
$claimcode = $_GET["claimcode"];
$mysql_array = dbloginreturn();
$host = $mysql_array['host'];
$login = $mysql_array['login'];
$password = $mysql_array['password'];
$database = $mysql_array['database'];
$link = mysql_connect($host, $login, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$display = mysql_query("select * from prizes where claimcode=$claimcode") or die(mysql_error());
$n = 1;
$prints = 0;
$posters = 0;
while($n1=mysql_fetch_array($display)) {
if ($n == 1) {
$user = $n1[user];
print "Congrationals $user on your prize winninsg!<br>
You have won:<br>";
}
$n++;
//print "$n1[user]<br>";
$user = $n1[user];
$prize = translation2($n1[prize]);
//once it's updated with prizes 101-103 i can set $printcountorsomething to sql fetch of
if ($n1[prize] == 5) { $postcards = $postcards + 1; }
if ($n1[prize] == 12) { $postcards = $postcards + 1; }
if ($n1[prize] == 13) { $prints = $prints + 1; }
if ($n1[prize] == 15) { $prints = $prints + 1; }
if ($n1[prize] == 19) { $prints = $prints + 5; } //Propogate the database with more individual 8.5x11's
//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
if ($n1[prize] == 21) { $prints = $prints + 5; }
if ($n1[prize] == 25) { $prints = $prints + 2; }
if ($n1[prize] == 26) { $prints = $prints + 10; }
if ($n1[prize] == 32) { $prints = $prints + 1; }
if ($n1[prize] == 37) { $prints = $prints + 1; }
if ($n1[prize] == 22) { $posters = $posters + 1; }
if ($n1[prize] == 29) { $posters = $posters + 3; }
print "$prize";
print "<br>";
}
//var_dump($_POST);
//quick little function to parse through the posted prints
$fname = $_POST['FName'];
$lname = $_POST['LName'];
$paint = $_POST['Paint'];
$signed = $_POST['Signed'];
$address1 = $_POST['Address1'];
$address2 = $_POST['Address2'];
$city = $_POST['City'];
$country = $_POST['country'];
$province = $_POST['province'];
$state = $_POST['state'];
$othercountry = $_POST['othercountry'];
$otherstate = $_POST['otherstate'];
$zip = $_POST['Zip'];
if ($country == "Canada") {
$canada = "selected=yes";
if ($province) {
if ($province == "BC") { $bc = "selected=yes"; }
if ($province == "AB") { $ab = "selected=yes"; }
if ($province == "SK") { $sk = "selected=yes"; }
if ($province == "MB") { $mb = "selected=yes"; }
if ($province == "ON") { $on = "selected=yes"; }
if ($province == "QB") { $qb = "selected=yes"; }
if ($province == "NL") { $nl = "selected=yes"; }
if ($province == "NB") { $nb = "selected=yes"; }
if ($province == "NS") { $ns = "selected=yes"; }
if ($province == "PE") { $pe = "selected=yes"; }
if ($province == "YK") { $yk = "selected=yes"; }
if ($province == "NV") { $nv = "selected=yes"; }
if ($province == "NT") { $nt = "selected=yes"; }
}
}
elseif ($country == "US") {
$us = "selected=yes";
if ($state) {
if ($state == "AK") { $ak = "selected=yes"; }
if ($state == "AR") { $ar = "selected=yes"; }
if ($state == "AL") { $al = "selected=yes"; }
if ($state == "AZ") { $az = "selected=yes"; }
if ($state == "CA") { $ca = "selected=yes"; }
if ($state == "CO") { $co = "selected=yes"; }
if ($state == "CT") { $ct = "selected=yes"; }
if ($state == "DE") { $de = "selected=yes"; }
if ($state == "FL") { $fl = "selected=yes"; }
if ($state == "GA") { $ga = "selected=yes"; }
if ($state == "HI") { $hi = "selected=yes"; }
if ($state == "IA") { $ia = "selected=yes"; }
if ($state == "ID") { $id = "selected=yes"; }
if ($state == "IL") { $il = "selected=yes"; }
if ($state == "IN") { $in = "selected=yes"; }
if ($state == "KS") { $ks = "selected=yes"; }
if ($state == "KY") { $ky = "selected=yes"; }
if ($state == "LA") { $la = "selected=yes"; }
if ($state == "MA") { $ma = "selected=yes"; }
if ($state == "MD") { $md = "selected=yes"; }
if ($state == "ME") { $me = "selected=yes"; }
if ($state == "MI") { $mi = "selected=yes"; }
if ($state == "MN") { $mn = "selected=yes"; }
if ($state == "MO") { $mo = "selected=yes"; }
if ($state == "MS") { $ms = "selected=yes"; }
if ($state == "MT") { $mt = "selected=yes"; }
if ($state == "NC") { $nc = "selected=yes"; }
if ($state == "ND") { $nd = "selected=yes"; }
if ($state == "NE") { $ne = "selected=yes"; }
if ($state == "NH") { $nh = "selected=yes"; }
if ($state == "NJ") { $nj = "selected=yes"; }
if ($state == "NM") { $nm = "selected=yes"; }
if ($state == "NV") { $nv = "selected=yes"; }
if ($state == "NY") { $ny = "selected=yes"; }
if ($state == "OH") { $oh = "selected=yes"; }
if ($state == "OK") { $ok = "selected=yes"; }
if ($state == "OR") { $or = "selected=yes"; }
if ($state == "PA") { $pa = "selected=yes"; }
if ($state == "RI") { $ri = "selected=yes"; }
if ($state == "SC") { $sc = "selected=yes"; }
if ($state == "SD") { $sd = "selected=yes"; }
if ($state == "TN") { $tn = "selected=yes"; }
if ($state == "TX") { $tx = "selected=yes"; }
if ($state == "UT") { $ut = "selected=yes"; }
if ($state == "VA") { $va = "selected=yes"; }
if ($state == "VT") { $vt = "selected=yes"; }
if ($state == "WA") { $wa = "selected=yes"; }
if ($state == "WI") { $wi = "selected=yes"; }
if ($state == "WV") { $wv = "selected=yes"; }
if ($state == "WY") { $wy = "selected=yes"; }
if ($state == "AS") { $as = "selected=yes"; }
if ($state == "DC") { $dc = "selected=yes"; }
if ($state == "GU") { $gu = "selected=yes"; }
if ($state == "MP") { $mp = "selected=yes"; }
if ($state == "PR") { $pr = "selected=yes"; }
if ($state == "VI") { $vi = "selected=yes"; }
}
}
elseif ($country == "Other") { $other = "selected=yes"; }
else { $country = "Canada"; $canada = "selected=yes"; $province_not_selected = "selected=yes"; }
if
(isset($_REQUEST['submitted'])) {
// Initialize error array.
$errors = array();
// Check for a proper First name
if (!empty($_REQUEST['FName'])) {
$FName = $_REQUEST['FName'];
$pattern = "/^[a-zA-Z]{2,20}/";
if (preg_match($pattern,$FName)){ $FName = $_REQUEST['FName'];}
else{ $errors[] = 'Your First name can only contain A-Z or a-z and be 2-20 characters long.';}
} else {$errors[] = 'You forgot to enter your First Name.';}
// Check for a proper Last name
if (!empty($_REQUEST['LName'])) {
$LName = $_REQUEST['LName'];
$pattern = "/^[a-zA-Z]{1,30}/";
if (preg_match($pattern,$LName)){ $LName = $_REQUEST['LName'];}
else{ $errors[] = 'Your Last name can only contain A-Z or a-z and be 1-20 characters long.';}
} else {$errors[] = 'You forgot to enter your Last Name.';}
//Address
if (!empty($_REQUEST['Address1'])) {
$Address1 = $_REQUEST['Address1'];
$pattern = "/^[a-zA-Z0-9\_]{1,100}/";
if (preg_match($pattern,$Address1)){ $Address1 =
$_REQUEST['Address1'];}
else{ $errors[] = 'Your Address 1 can only contain _, 1-9, A-Z or a-z 1-100
long.';}
} else {$errors[] = 'You forgot your Address 1.';}
//Address 2
if (!empty($_REQUEST['Address2'])) {
$Address2 = $_REQUEST['Address2'];
$pattern = "/^[a-zA-Z0-9\_]{1,100}/";
if (preg_match($pattern,$Address2)){ $Address2 = $_REQUEST['Address2'];}
else{ $errors[] = 'Your Address 2 can only contain _, 1-9, A-Z or a-z
2-100 long.';}
}
//Signed too
if (!empty($_REQUEST['Signed'])) {
$Signed = $_REQUEST['Signed'];
} else {
$Signed = $FName;
}
function checkPaint($checktype) {
$z = 1;
$errors = array();
while (isset($_REQUEST["{$checktype}{$z}"])) {
print_r($_REQUEST);
print "REQUEST: " . $_REQUEST["{$checktype}{$z}"] . "<BR>";
print "<br><br>.<br>" . $_REQUEST["{$checktype}{$z}"] . "<br>.<br><br>";
$check = $_REQUEST["{$checktype}{$z}"];
$against = "-CHOOSE YOUR PAINT-";
print "<br><br>";
var_dump($check);
var_dump($against);
if ($_REQUEST["{$checktype}{$z}"] == "-CHOOSE YOUR PAINT-") { $errors[] = "You forgot your $z $checktype";}
elseif ($_REQUEST["{$checktype}{$z}"] == "-") { $errors[] = "You forgot your $z $checktype";}
$z++;
}
print "Errors: ";
var_dump($errors);
return $errors;
}
$errors = array_merge($errors, checkPaint('Postcards'));
$errors = array_merge($errors, checkPaint('Prints'));
$errors = array_merge($errors, checkPaint('Posters'));
// print "<br><br>";
// var_dump($errors);
//CITY
if (!empty($_REQUEST['City'])) {
$City = $_REQUEST['City'];
$pattern = "/^[a-zA-Z0-9\_]{1,100}/";
if (preg_match($pattern,$City)){ $City = $_REQUEST['City'];}
else{ $errors[] = 'Your City can only contain _, 1-9, A-Z or a-z 2-100 long.';}
} else {$errors[] = 'You forgot your City.';}
//STATE
if ($country == "US" && empty($_REQUEST['state'])) {
$errors[] = 'You forgot your State.';
}
//PROVINCE
if ($country == "Canada" && empty($_REQUEST['province'])) {
$errors[] = 'You forgot your Province.';
}
//COUNTRY
if (($country == "Other") && (!empty($_REQUEST['othercountry']))) {
$othercountry = $_REQUEST['othercountry'];
$pattern = "/^[a-zA-Z0-9\_]{2,100}/";
if (preg_match($pattern,$othercountry)){ $othercountry = $_REQUEST['othercountry'];}
else{ $errors[] = 'Your Country can only contain _, 1-9, A-Z or a-z
2-100 long.';}
} elseif ($country == "Other") {$errors[] = 'You forgot your Country.';}
//ZIP/POSTAL
if (!empty($_REQUEST['Zip'])) {
$Zip = $_REQUEST['Zip'];
$pattern = "/^[a-zA-Z0-9\_]{2,100}/";
if (preg_match($pattern,$Zip)){ $Zip = $_REQUEST['Zip'];}
else{ $errors[] = 'Your Zip/Postal can only contain _, 1-9, A-Z or a-z
2-100 long.';}
} else {$errors[] = 'You forgot your Zip/Postal.';}
}
//End of validation
/*
*
* MOOOOOOOOOOSSSSSEEEEEEEE HERE!!!!!!!!!!!!!!!!!
*
*/
if (isset($_REQUEST['submitted'])) {
if (empty($errors)) {
$myfile = fopen("Mailing.txt", "a");
$nwln = "\r\n";
$com = ", ";
fwrite ($myfile, "$user - ");
fwrite ($myfile, $Paint);
fwrite ($myfile, "Signed to - $Signed");
fwrite ($myfile, $nwln);
fwrite ($myfile, $nwln);
fwrite ($myfile, "$FName $LName");
fwrite ($myfile, $nwln);
fwrite ($myfile, $Address1);
fwrite ($myfile, $nwln);
if (!empty($Address2)) {
fwrite ($myfile, $Address2);
fwrite ($myfile, $nwln);
}
fwrite ($myfile, $City);
fwrite ($myfile, $com);
if (!empty($state)) {
fwrite ($myfile, $state);
fwrite ($myfile, $com);
}
if (!empty($province)) {
fwrite ($myfile, $province);
fwrite ($myfile, $com);
}
if (!empty($otherstate)) {
fwrite ($myfile, $otherstate);
fwrite ($myfile, $com);
}
if ($country == "US") { $country = "USA"; }
if ($country == "Other") { $country = $othercountry; }
fwrite ($myfile, $country);
fwrite ($myfile, $nwln);
$Zip = strtoupper($Zip);
fwrite ($myfile, $Zip);
fwrite ($myfile, $nwln);
fwrite ($myfile, $nwln);
fwrite ($myfile, $nwln);
fwrite ($myfile, $nwln);
$link = mysql_connect($host, $login, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$provinceForTheDatabase = $province . $state . $otherstate;
mysql_query("REPLACE INTO addresses
(user, firstname, lastname, addy1, addy2, city, province, country, zip)
VALUES
('$user', '$FName', '$LName', '$Address1', '$Address2', '$City', '$provinceForTheDatabase', '$country', '$zip')") or die(mysql_error());
mysql_close($link);
//for moving prizes from prizes to prizes-claimed
$link = mysql_connect($host, $login, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$prizes_to_move = mysql_query("select * from prizes where claimcode=$claimcode") or die(mysql_error());
$print_number = 1;
$postcards_number = 1;
$posters_number = 1;
while($n1=mysql_fetch_array($prizes_to_move)) {
// print_r($n1);
// print "<br>Translation:";
// print translation2($n1[prize]);
// print "<br>.<br>";
if (translation2($n1[prize]) == "4x6 Print") {
$id = $n1[id];
$prize = $n1[prize];
$print_title = $_POST['Postcards' . $postcards_number];
$sign_to = $_POST['Signed_Postcards_' . $postcards_number];
if (!$sign_to) { $sign_to = $FName; }
$ctime = $n1[ctime];
print "<BR>4x6<br>INSERT INTO `prizes-claimed`
(`user`, `prize`, `4x6`, `SignTo`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)";
mysql_query("INSERT INTO `prizes-claimed`
(`user`, `prize`, `4x6`, `SignTo`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
$postcards_number++;
}
elseif ((translation2($n1[prize]) == "8.5x11 Print") || (translation2($n1[prize]) == "6 Months Print")) {
$id = $n1[id];
$prize = $n1[prize];
$print_title = $_POST['Prints' . $print_number];
$sign_to = $_POST['Signed_Prints_' . $print_number];
if (!$sign_to) { $sign_to = $FName; }
$ctime = $n1[ctime];
/*
print "<br>8.5x11<br>INSERT INTO `prizes-claimed`
(`user`, `prize`, `8.5x11`, `SignTo`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)";
*/
mysql_query("INSERT INTO `prizes-claimed`
(`user`, `prize`, `8.5x11`, `SignTo`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
$print_number++;
}
elseif (translation2($n1[prize]) == "12x18 Poster") {
$id = $n1[id];
$prize = $n1[prize];
$print_title = $_POST['Posters' . $posters_number];
$sign_to = $_POST['Signed_Posters_' . $posters_number];
if (!$sign_to) { $sign_to = $FName; }
$ctime = $n1[ctime];
mysql_query("INSERT INTO `prizes-claimed`
(`user`, `prize`, `12x18`, `SignTo`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', '$print_title', '$sign_to', $ctime, $claimcode)") or die(mysql_error());
mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
$posters_number++;
}
else {
$id = $n1[id];
$prize = $n1[prize];
$ctime = $n1[ctime];
mysql_query("INSERT INTO `prizes-claimed`
(`user`, `prize`, `ctime`, `claimcode`)
VALUES
('$user', '$prize', $ctime, $claimcode)") or die(mysql_error());
mysql_query("DELETE FROM `prizes` WHERE `id`=$id") or die(mysql_error());
}
print "<br><br>";
}
}
}
/*
*
* END FORMATTING!!!!!!!!!!!!!!!!!
*
*/
?>
<?php
//Print Errors
if (isset($_REQUEST['submitted'])) {
// Print any error messages.
if (!empty($errors)) {
echo '<hr /><h3>The following occurred:</h3><ul>';
// Print each error.
foreach ($errors as $msg) { echo '<li>'. $msg . '</li>';}
echo '</ul><h3>Your Address could not be sent due to input errors.</h3><hr />';
}
else {
echo '<hr /><h3 align="center">Your mail was sent. Thank you!</h3><hr />
<p>If the information below is not correct, go back and send moose another whisper.</p>';
print ("$user <br /><br />");
print ("$FName $LName <br />");
print ("$Address1 <br />");
if (!empty($Address2)) {
print ("$Address2 <br />");
}
print ($City);
print ($com);
if (!empty($state)) {
print ($state);
print ($com);
}
if (!empty($province)) {
print ($province);
print ($com);
}
if (!empty($otherstate)) {
print ($otherstate);
print ($com);
}
if ($country == "Other") { print "$othercountry <br>"; }
else { print ("$country <br />"); }
print ("$zip <br /> <br /> <br /> <br />");
}
}
if (empty($errors) && isset($_REQUEST['submitted'])) { die(); }
//End of errors array
print "
<h1>
Give Moose your info!
</h1>
<h2>
This form is incompatible with some versions Safari</h2>
If you're using safari, switch to a different browser.
Otherwise don't sweat it.<br><br>
<p>
Fill out the form below to get your prize(s).
</p>
<form action=\"\" method=\"post\">
<Br>
<label>First Name: <br />
<input name=\"FName\" type=\"text\" value=\"$fname\" /><br /></label>
<label>Last Name: <br />
<input name=\"LName\" type=\"text\" value=\"$lname\" /><br /></label>
<label>Address 1: <br />
<input name=\"Address1\" type=\"text\" value=\"$address1\" /><br /></label>
<label>Address 2: <br />
<input name=\"Address2\" type=\"text\" value=\"$address2\" /><br /></label>
<label>City: <br />
<input name=\"City\" type=\"text\" value=\"$city\" /><br /></label>
Country:
<SELECT NAME=\"country\" onchange=\"this.form.submit()\">
<OPTION VALUE=\"Canada\" $canada>Canada
<OPTION VALUE=\"US\" $us>US
<OPTION VALUE=\"Other\" $other>Other
</SELECT><br>
";
if ($canada == "selected=yes") {
print " Province
<SELECT NAME=\"province\" onchange=\"this.form.submit()\">
<OPTION VALUE=\"\" $province_not_selected>Select Province
<OPTION VALUE=\"BC\" $bc>British Columbia
<OPTION VALUE=\"AB\" $ab>Alberta
<OPTION VALUE=\"SK\" $sk>Saskatchewan
<OPTION VALUE=\"MB\" $mb>Manitoba
<OPTION VALUE=\"ON\" $on>Ontario
<OPTION VALUE=\"QB\" $qb>Quebec
<OPTION VALUE=\"NL\" $nl>Newfoundland
<OPTION VALUE=\"NB\" $nb>New Brunswick
<OPTION VALUE=\"NS\" $ns>Nova Scotia
<OPTION VALUE=\"PE\" $pe>P.E.I.
<OPTION VALUE=\"YK\" $yk>YK
<OPTION VALUE=\"NV\" $nv>Nunavut
<OPTION VALUE=\"NT\" $nt>NW Territories
</SELECT>
<br>"; }
if ($us == "selected=yes") {
print " State
<SELECT NAME=\"state\" onchange=\"this.form.submit()\">
<OPTION VALUE=\"\" $province_not_selected>Select State
<OPTION VALUE=\"AK\" $ak>Alaska
<OPTION VALUE=\"AL\" $al>Alabama
<OPTION VALUE=\"AR\" $ar>Arkansas
<OPTION VALUE=\"AZ\" $az>Arizona
<OPTION VALUE=\"CA\" $ca>California
<OPTION VALUE=\"CO\" $co>Colorado
<OPTION VALUE=\"CT\" $ct>Connecticut
<OPTION VALUE=\"DE\" $de>Delaware
<OPTION VALUE=\"FL\" $fl>Florida
<OPTION VALUE=\"GA\" $ga>Georgia
<OPTION VALUE=\"HI\" $hi>Hawaii
<OPTION VALUE=\"IA\" $ia>Iowa
<OPTION VALUE=\"ID\" $id>Idaho
<OPTION VALUE=\"IL\" $il>Illinois
<OPTION VALUE=\"IN\" $in>Indiana
<OPTION VALUE=\"KS\" $ks>Kansas
<OPTION VALUE=\"KY\" $ky>Kentucky
<OPTION VALUE=\"LA\" $la>Louisiana
<OPTION VALUE=\"MA\" $ma>Massachusetts
<OPTION VALUE=\"MD\" $md>Maryland
<OPTION VALUE=\"ME\" $me>Maine
<OPTION VALUE=\"MI\" $mi>Michigan
<OPTION VALUE=\"MN\" $mn>Minnesota
<OPTION VALUE=\"MO\" $mo>Missouri
<OPTION VALUE=\"MS\" $ms>Mississippi
<OPTION VALUE=\"MT\" $mt>Montana
<OPTION VALUE=\"NC\" $nc>North Carolina
<OPTION VALUE=\"ND\" $nd>North Dakota
<OPTION VALUE=\"NE\" $ne>Nebraska
<OPTION VALUE=\"NH\" $nh>New Hampshire
<OPTION VALUE=\"NJ\" $nj>New Jersey
<OPTION VALUE=\"NM\" $nm>New Mexico
<OPTION VALUE=\"NV\" $nv>Nevada
<OPTION VALUE=\"NY\" $ny>New York
<OPTION VALUE=\"OH\" $oh>Ohio
<OPTION VALUE=\"OK\" $ok>Oklahoma
<OPTION VALUE=\"OR\" $or>Oregon
<OPTION VALUE=\"PA\" $pa>Pennsylvania
<OPTION VALUE=\"RI\" $ri>Rhode Island
<OPTION VALUE=\"SC\" $sc>South Carolina
<OPTION VALUE=\"SD\" $sd>South Dakota
<OPTION VALUE=\"TN\" $tn>Tennessee
<OPTION VALUE=\"TX\" $tx>Texas
<OPTION VALUE=\"UT\" $ut>Utah
<OPTION VALUE=\"VA\" $va>Virginia
<OPTION VALUE=\"VT\" $vt>Vermont
<OPTION VALUE=\"WA\" $wa>Washington
<OPTION VALUE=\"WI\" $wi>Wisconsin
<OPTION VALUE=\"WV\" $wv>West Virginia
<OPTION VALUE=\"WY\" $wy>Wyoming
<OPTION VALUE=\"AS\" $as>American Samoa
<OPTION VALUE=\"DC\" $dc>District of Columbia
<OPTION VALUE=\"GU\" $gu>Guam
<OPTION VALUE=\"MP\" $mp>Mariana Islands
<OPTION VALUE=\"PR\" $pr>Puerto Rico
<OPTION VALUE=\"VI\" $vi>Virgin Islands
</SELECT>
<br>";
}
if ($other == "selected=yes") {
print "Country:
<input name=\"othercountry\" type=\"text\" value=\"$othercountry\" /><br>";
print "State/Province:
<input name=\"otherstate\" type=\"text\" value=\"$otherstate\" /><br>";
}
print "<label>zip/postal: <br />
<input name=\"Zip\" type=\"text\" value=\"$zip\" /><br
/></label>
<br />
<br />";
//TURNOOFFF THIS HARDCODED $PRINTS
//$prints = 3;
//$posters = 3;
//print " prints : $prints posters : $posters<br>";
$printscounter = 1;
$postercounter = 1;
function printDropdowns($type,$count,$dropdownprint) {
for ($counter = 1; $counter <= $count; $counter++) {
print " <label>Character $type $counter?<br />
<select name=\"{$type}{$counter}\">";
print "$dropdownprint
</select></label><br>
<label>Signed To: <br />
(If Left Blank Will Sign to First Name Provided) <br />
<input name=\"Signed_{$type}_{$counter}\" type=\"text\" value=\"\" /><br /></label>";
print "<br>
";
}
}
$dropdownprint = '';
$lines = file('characters.txt');
foreach($lines as $character) {
$character = trim($character);
$dropdownprint .= "<option value=\"" . $character . "\">" . $character . "</option>
";
}
if ($postcards > 0) {
printDropdowns('Postcards',$postcards,$dropdownprint);
}
if ($prints > 0) {
printDropdowns('Prints',$prints,$dropdownprint);
}
if ($posters > 0) {
printDropdowns('Posters',$posters,$dropdownprint);
}
print "
<input name=\"submitted\" type=\"submit\" value=\"Submit\" />
</form><br><br><br><br><br>
Form contributed to by AlexaSimonSaysHello and Nemesis851 and Oewyn and mzcosty and typedefeX and Reecon820
";
?>