very strange...
my code should print out the variables but dont, every other page seems to work fine. Have a look at this:
Registration Results:
Your name is $first_name
..Jeez! You left out your Last Name!
Your email address is $email
You entered your date of birth as $birthdate.
as you can see the code checks to see that form fields aren't empty (no last name) but the actual variables have not been displayed. Any ideas? Here's the code:
<?php
//address error reporting
ini_set ('display_erors',1);
error_reporting (E_ALL & ~ E_NOTICE);
$first_name= $POST['first_name'];
$last_name = $POST['last_name'];
$email = $POST['email'];
$password = $POST['password'];
$confirm = $POST['confirm'];
$month = $POST['month'];
$day = $POST['day'];
$year = $POST['year'];
print '<p>Registration Results: </p>';
//validate stuff
if (empty ($first_name)) {
print '<p>For gods sake FILL the form in! You left out your First Name!</p>';
} else {
print 'Your name is $first_name';
}
if (empty ($last_name)) {
print '<p>..Jeez! You left out your Last Name!</p>';
} else {
print '$last_name';
}
if (empty ($email)) {
print '<p>Damnit FILL the form in! You left out your Email!</p>';
} else {
print '<p>Your email address is $email</p>';
}
if (empty ($password)) {
print '<p>What? No Password? Are you mad?</p>';
}
if (is_numeric($month)) {
$birthdate = $month . '-';
} else {
print '<p>please select the month you were born</p>';
}
if (is_numeric($day)) {
$birthdate .= $day . '-';
} else {
print '<p>please select the day you were born</p>';
}
if (is_numeric($year)) {
$birthdate .= $year;
} else {
print '<p>please type the year you were born as 4 digits</p>';
}
if (checkdate($month, $day, $year)) {
print '<p>You entered your date of birth as $birthdate.</p>';
} else {
print '<p>That is not a proper date!</p>';
}
?>
Should work fine as far as i can tell but you know us noobs....