I already have a form defined in a content page that accepts the info I need, I'm working on the post target page, which is the basic "read things out of _POST and execute an INSERT statement against a table" type of thing. I am trying to do this as a content page containing a single UDT, which in turn contains my post-processing code, which, for the sake of completeness, looks like this:
Code: Select all
if( count($_POST) != 0 && isset($_POST["submit"]))
{
$real_name = mysql_real_escape_string($_POST["real_name"]);
$gamer_name = mysql_real_escape_string($_POST["gamer_name"]);
$email = mysql_real_escape_string($_POST["email"]);
$age = mysql_real_escape_string($_POST["age"]);
$birth_month = mysql_real_escape_string($_POST["birth_month"]);
$birth_day = mysql_real_escape_string($_POST["birth_day"]);
$preferred_tryout = mysql_real_escape_string($_POST["preferred_tryout"]);
$query = "INSERT INTO cs_tryouts VALUES ('$real_name', '$gamer_name', '$email', $age, $birth_month, $birth_day, '$preferred_tryout')";
$linkid = @mysql_connect("localhost", "[CENSORED]", "[CENSORED]");
or die("Could not open MySQL on localhost");
@mysql_select_db("w00tz_tryouts") or die("Count not open database w00tz_tryouts");
$result = mysql_query($query);
if($result)
{
echo( "Thanks for registering, $gamer_name. We will contact you via e-mail shortly with a definite tryout date. If you have any questions regarding your registration, please feel free to contact w00tz! directly.");
}
else
{
echo("There was a problem processing your registration. Please try again later.");
}
@mysql_close();
exit;
}
else
{
echo("You have reached this page in error. [<a href='index.php'>Return to w00tz!</a>]");
}

