function Parse_Form() { $out = array(); $method = $_SERVER['REQUEST_METHOD']; if ($method == "GET") { foreach ($_GET as $key => $value) { $out[$key] = $value; } } elseif ($method == "POST") { foreach ($_POST as $key => $value) { $out[$key] = $value; } } else { $out = ""; } return $out; } $formData = Parse_Form(); foreach ($formData as $key => $value) { $$key = $value; } if (!ini_get("register_globals")) { extract($_GET, EXTR_SKIP); } include("config.php"); include("$header"); if (!$action) { ?>
Fill out the form below to add a horse's name. Please note: this form is for new names only! Use the search form (link is at the bottom) to see if your horse is already added before submitting. If it is, use the edit form to change something. Please submit this form once per horse - do not submit multiple names in one form.
} elseif ($action == "new"){ if (!isset($_POST[quote]) || !isset($_POST[author])) { header( "$siteurl/add2.php" ); } elseif (empty($_POST[quote]) || empty($_POST[author])) { echo "Oops, it appears you forgot to enter either a name or the player name. Please press the BACK button in your browser and try again.
"; } else { $query = "INSERT INTO $table VALUES ('','','$quote','$author','$complem','$name','$url','$email','$comments','$apr')"; mysql_query($query); $query="SELECT quoteID FROM $table WHERE email='$email'"; $result=mysql_query($query); $num=mysql_numrows($result); if ($emailnotify == 'Y'){ $msg = "Name:\t$_POST[name]\n"; $msg .= "E-Mail:\t$_POST[email]\n"; $msg .= "URL:\t$_POST[url]\n"; $msg .= "Quote:\t$_POST[quote]\n"; $msg .= "Author:\t$_POST[author]\n"; $msg .= "Author Complement:\t$_POST[complem]\n"; $msg .= "Comments:\t$_POST[comments]\n"; $msg .= "Sender IP:\t$REMOTE_ADDR\n"; $msg .= "\nLogin to your Admin Panel: $siteurl/admin.php\n"; $recipient = "$adminemail"; $subject = "$sitename"; $mailheaders = "From: $_POST[email]\n"; $mailheaders .= "Reply-To: $_POST[email]\n\n"; mail($recipient, $subject, $msg, $mailheaders); } echo "Thank you, $_POST[name]! This name will be added to the list with the next update. :)
"; } } elseif ($action == "update"){ ?>Please use the form below to correct a name. If you wish to add a new name, use this form. Thanks!
You are NOT allowed to change a horse's name without permission from an officer, and definitely not because you "chose the wrong name" or "got tired of that name."
Oops, it appears you forgot to enter either the horse name, or the player name. Please press the BACK button in your browser and try again.
"; } else { $msg = "Quote:\t$_POST[quote]\n"; $msg .= "Author:\t$_POST[author]\n"; $msg .= "Author Complement:\t$_POST[complem]\n"; $msg .= "Name:\t$_POST[name]\n"; $msg .= "E-Mail:\t$_POST[email]\n"; $msg .= "URL:\t$_POST[url]\n"; $msg .= "Changes:\t$_POST[comments]\n"; $msg .= "Sender IP:\t$REMOTE_ADDR\n"; $msg .= "\nLogin to your Admin Panel: $siteurl/admin.php\n"; $recipient = "$adminemail"; $subject = "$sitename - update"; $mailheaders = "From: $_POST[email]\n"; $mailheaders .= "Reply-To: $_POST[email]\n\n"; mail($recipient, $subject, $msg, $mailheaders); echo "Thanks, your update has been sent. I will correct it as soon as possible!
"; ?> } } ?> include("$footer"); ?>