the problem is only the password is stored but the rest doesnt...
this is the php code
<?php
define('DB_NAME','my_db');
define('DB_USER','root');
define('DB_PASSWORD','123');
define('DB_HOST','localhost');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
$firstname = isset($_POST['fname']) ? $_POST['fname'] : '';
$lastname =isset($_POST['lname']) ? $_POST['lname'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$bday = isset($_POST['bday']) ? $_POST['bday'] : '';
$gender = isset($_POST['gender']) ? $_POST['gender'] : '';
$pass = isset($_POST['password']) ? $_POST['password'] : '';
$submit = isset($_POST['submit']) ? $_POST['submit'] : null;
$sql = "INSERT INTO user(fname,lname,email,bday,gender,password)
VALUES ('$firstname','$lastname','$email','$bday','$gender','$pass')";
if(!mysql_query($sql)){
die('Error: ' . mysql_error());
}
mysql_close();
?>
this is the html code
<form action="connect.php" method="post">
First name: <input type="password" name="fname">
Last name: <input type="text" name="lname"><br><br>
Email Address: <input type="email" name="email"><br><br>
Birthday: <input type="date" name="bday">
Sex: <input list="Sex" name="gender">
Password: <input type="password" name="password"><br><br>
<datalist id="Sex">
<option value="Male">
<option value="Female">
</datalist><br><br>
<input type="submit" value="Sign up!" id="btnsignup" />
</form>
*data types in the table are: fname is varchar, lname is varchar, email is varchar, bday is date, gender is char, password is char *
First of all, your HTML can only be used with the newest browsers. Try this instead to support older browsers (perhaps you've got one too and that is the problem):
<form action="connect.php" method="post">
First name: <input type="text" name="fname">
Last name: <input type="text" name="lname"><br><br>
Email Address: <input type="text" name="email"><br><br>
Birthday: <input type="text" name="bday" placeholder="YYYY-MM-DD">
Sex: <select name="gender">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
Password: <input type="password" name="password"><br><br>
<input type="submit" value="Sign up!" id="btnsignup" />
</form>
You can use var_dump($_POST) or print_r($_POST) in the first line before all other code in your PHP script to check if the POST input from your HTML reaches the PHP.
As a alternative you can check the output of var_dump($_REQUEST), this array will contain GET and POST variables.
Double check if there is other PHP code executed before the one you've posted (redirects, manipulating $_POST vars and so on).
Also check if there are cookies, $_SERVER or ENV variables set with the variable names you have used.
In normal circumstances your example code should work.
Please check character limit of field in table or field name in table. I think there is the problem.
Related
I decided to do a little test by testing to see if the form would detect an empty input field, and it didn't work, I don't know what the problem is and I don't want to write the rest of the project if this one small thing doesn't work so here's the code, I've looked over it and I don't think I've missed anything.
Here's the HTML:
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form method="POST" action="myform.php">
<fieldset>
<legend>Personal Info</legend>
First name <input name="name" type="text">
Middle name <input name="middlename" type="text">
Surname <input name="lastname" type="text">
Age <input name="age" type="number">
Date of birth <input name="dob" type="date">
</fieldset>
<fieldset>
<legend>Regional & location info</legend>
Continent
<select>
<option value="europe">Europe</option>
<option value="americas">America</option>
<option value="africa">Africa</option>
<option value="asia">Asia</option>
<option value="australia">Australia</option>
<option value="eurasia">Eurasia</option>
</select>
Country <input type="text"> State <input type="text">
City <input type="text">
Street number <input type="number">
Street name <input type="text"> <br><br>
Suburb <input type="text"> Postcode <input type="number">
If none of these apply to your accommodations, enter a typed location here <input type="text">
</fieldset>
<fieldset>
<legend>Previous lifestyle accommodations</legend>
Previous &/or most recent job title <input name="job" type="text">
First time job seeker <input type="checkbox" name="check1" value="ftjb">
I'm a student <input type="checkbox" name="check2" value="ias">
Previous &/or most recent acedemic title <input name="school" type="text">
First time applying for a qualification <input type="checkbox" name="check3" value="ftafaq">
I have work experience <input type="checkbox" name="check4" value="ihwe">
</fieldset>
<fieldset>
<legend>Details of arrival</legend>
Reason for arrival of all parties <input name="reason" type="text">
Date of arrival <input name="arrival" type="date">
Amount of stay expectancy
<input type="checkbox" name="check3">Temporary
<input type="checkbox" name="check4">Longterm
</fieldset>
<fieldset>
<legend>Signiture</legend>
<input type="text">
</fieldset>
<input type="submit" value="Submit"><button type="reset">Reset</button>
</form>
</body>
</html>
And here's what I've done in PHP so far for the form:
<?php
$nameInvalid = "";
$middleInvalid = "";
$surnameInvalid = "";
$ageInvalid = "";
$dobInvalid = "";
$countryInvalid = "";
$cityInvalid = "";
$strtInvalid = "";
$strnameInvalid = "";
$suburbInvalid = "";
$postcodeInvalid = "";
$jobInvalid = "";
$ftjsInvalid = "";
$iasInvalid = "";
$schoolInvalid = "";
$check1Invalid = "";
$check2Invalid = "";
$checl3Invalid = "";
$check4Invalid = "";
$reasonInvalid = "";
$arrivalInvalid = "";
if (isset($_POST['submit'])) {
if (empty($_POST["name"])) {
$nameInvalid = "Name is required";
}
}
?>
Please add name="submit" attribute into the button.
<input type="submit" value="Submit" name="submit">
And also please add echo into the validation to print validation message like below.
if (isset($_POST['submit'])) {
if (empty($_POST["name"])) {
echo $nameInvalid = "Name is required";
}
}
Use this
<input type="submit" name="submit" value="Submit">
HTML
You need to use HTML5 validation to prevent the form from being sent if it doesn't conform to your rules.
From the official documentation:
The simplest HTML5 validation feature to use is the required attribute — if you want to make an input mandatory, you can mark the element using this attribute. When this attribute is set, the form won't submit (and will display an error message) when the input is empty (the input will also be considered invalid).
In your case, try adding the required tag to the fields you want to test, for instance the name field:
First name <input name="name" type="text" required>
To make it a little bit more fancy, add some CSS:
input:invalid {
border: 2px dashed red;
}
input:valid {
border: 2px solid black;
}
PHP
To validate PHP responses, all you need to do is the following:
if (!$_REQUEST["name"]) {
//If the name field is empty
die("Name is missing");
//Replace this with whatever logic fits your code
}
We're using $_REQUEST, which means both $_POST and $_GET, but you can stick to $_POST if you'd like. We're using if(!$val) to validate, it's the easiest way, but has caveats (see below), you can also use if(empty($val)) but for strings, the first is fine.
Get rid of the list of variables you define as empty in the beginning of your script. Instead look at setting an array if a value that shouldn't be empty, is empty. For instance:
# Repeat this structure for each form field you want
if (!$_REQUEST["name"]) {
//If the name field is empty
$empty_fields[] = "name";
//Fill the $empty_fields array with all the fields that are missing
}
# At the end, cycle thru the missing fields and tell the user
if(!empty($empty_fields)){
die("The following fields are missing: ".implode(", ", $empty_fields));
}
Caveat
Using a if(!$val) is a shortcut, and won't work if you allow values like " " (space) or "0" (zero), but works fine if you're expecting string values.
I checked code and its working properly. Just give name to submit button and echo validation message in php page.
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form method="POST" action="test1.php">
<fieldset>
<legend>Personal Info</legend>
First name <input name="name" type="text">
Middle name <input name="middlename" type="text"> Surname <input name="lastname" type="text"> Age <input name="age" type="number"> Date of birth <input name="dob" type="date">
</fieldset>
<fieldset>
<legend>Regional & location info</legend>
Continent
<select>
<option value="europe">Europe</option>
<option value="americas">America</option>
<option value="africa">Africa</option>
<option value="asia">Asia</option>
<option value="australia">Australia</option>
<option value="eurasia">Eurasia</option>
</select>
Country <input type="text"> State <input type="text"> City <input type="text">
Street number <input type="number"> Street name <input type="text"> <br><br>
Suburb <input type="text"> Postcode <input type="number"> If none of these apply to your accommodations, enter a typed location here <input type="text">
</fieldset>
<fieldset>
<legend>Previous lifestyle accommodations</legend>
Previous &/or most recent job title <input name="job" type="text"> First time job seeker <input type="checkbox" name="check1" value="ftjb"> I'm a student <input type="checkbox" name="check2" value="ias"> Previous &/or most recent acedemic title <input name="school" type="text"> First time applying for a qualification <input type="checkbox" name="check3" value="ftafaq"> I have work experience <input type="checkbox" name="check4" value="ihwe">
</fieldset>
<fieldset>
<legend>Details of arrival</legend>
Reason for arrival of all parties <input name="reason" type="text"> Date of arrival <input name="arrival" type="date"> Amount of stay expectancy <input type="checkbox" name="check3">Temporary <input type="checkbox" name="check4">Longterm
</fieldset>
<fieldset>
<legend>Signiture</legend>
<input type="text">
</fieldset>
<input type="submit" name="submit" value="Submit">
<button type="reset">Reset</button>
</form>
</body>
</html>
Display echo message in php page.
<?php
$nameInvalid = "";
$middleInvalid = "";
$surnameInvalid = "";
$ageInvalid = "";
$dobInvalid = "";
$countryInvalid = "";
$cityInvalid = "";
$strtInvalid = "";
$strnameInvalid = "";
$suburbInvalid = "";
$postcodeInvalid = "";
$jobInvalid = "";
$ftjsInvalid = "";
$iasInvalid = "";
$schoolInvalid = "";
$check1Invalid = "";
$check2Invalid = "";
$checl3Invalid = "";
$check4Invalid = "";
$reasonInvalid = "";
$arrivalInvalid = "";
if (isset($_POST['submit']))
{
if (empty($_POST["name"]))
{
echo $nameInvalid = "Name is required";
}
}
?>
Its done.
I'm learning some more PHP and after PHP itself to work, I can't seem to get it to validate any form field correctly. My goal is to check if the firstname field is empty, and if it is, it will give a message in a red color. The message in the red works, but only because the echo script is being called by the form submission, not because it has detected any empty field, because when I made an else statement to say "wassup" if its not empty, I got the same message for when the field is empty. Also, is there a way to check off multiple input fields at once like you could with JavaScript? For example if input1 == '' || input2 == '' and so on. Here is my HTML:
<html>
<head>
<title>Welcome</title>
</head>
<body>
<form action="welcome.php" method="post">
<fieldset>
<legend>Personal Info</legend>
First name <input name="name" type="text">
Middle name <input name="middlename" type="text">
Surname <input name="lastname" type="text">
Age <input name="age" type="number">
Date of birth <input name="dob" type="date">
</fieldset>
<fieldset>
<legend>Regional & location info</legend>
Continent
<select>
<option value="europe">Europe</option>
<option value="americas">America</option>
<option value="africa">Africa</option>
<option value="asia">Asia</option>
<option value="australia">Australia</option>
<option value="eurasia">Eurasia</option>
</select>
Country <input name="country" type="text"> State <input type="text">
City <input name="city" type="text">
Street number <input name="streetno" type="number">
Street name <input name="streetname" type="text"> <br><br>
Suburb <input name="suburb" type="text"> Postcode <input name="postcode" type="number">
If none of these apply to your accommodations, enter a typed location here <input type="text">
</fieldset>
<fieldset>
<legend>Previous lifestyle accommodations</legend>
Previous &/or most recent job title <input name="job" type="text">
First time job seeker <input type="checkbox" name="check1" value="ftjb">
I'm a student <input type="checkbox" name="check2" value="ias">
Previous &/or most recent acedemic title <input name="school" type="text">
First time applying for a qualification <input type="checkbox" name="check3" value="ftafaq">
I have work experience <input type="checkbox" name="check4" value="ihwe">
</fieldset>
<fieldset>
<legend>Details of arrival</legend>
Reason for arrival <input name="reason" type="text">
Date of arrival <input name="arrival" type="date">
Amount of stay expectancy
<input type="checkbox" name="check3">Temporary
<input type="checkbox" name="check4">Longterm
</fieldset>
<fieldset>
<legend>Signiture</legend>
<input name='signiture' type="text">
</fieldset>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
Here is my PHP code:
<?php
$firstname = $_POST['name'];
$lastname = $_POST['lastname'];
$age = $_POST['age'];
$dob = $_POST['dob'];
$country = $_POST['country'];
$city = $_POST['city'];
$suburb = $_POST['suburb'];
$postcode = $_POST['postcode'];
$streetno = $_POST['streetno'];
$streetname = $_POST['streetname'];
$suburb = $_POST['suburb'];
$job = $_POST['job'];
$school = $_POST['school'];
$reason = $_POST['reason'];
$arrival = $_POST['arrival'];
$signiture = $_POST['signiture'];
if (isset($_POST['submit'])) {
if (empty($_POST[$firstname])) {
echo '<p style="color: red; text-align: center">Your first name is required</p>';
} else {
echo "wassaup";
}
}
?>
In your if statement, you need to do this:
if (empty($_POST['name'])) { //Or replace $_POST['name'] with $firstname
echo '<p style="color: red; text-align: center">Your first name is required</p>';
} else {
echo "wassaup";
}
You have a wrong syntax if (empty($_POST[$firstname])). You should use ' ' single paranthesis in firstname and remove this sign $.
change this if (empty($_POST[$name])) { to if (empty($_POST['firstname'])) { and check again. your syntax is wrong that's why it is not working.
Change in your code
if (!isset($_POST['firstname'] || empty($_POST['firstname'])) {
echo '<p style="color: red; text-align: center">Your first name is required</p>';
} else {
echo "wassaup";
}
First you can create error array where you will put all yours errors
$error = array();
then when you check for multiple fields
if (empty($_POST['firstname'])) $error[] = "First name can't be empty";
if (empty($_POST['lastname'])) $error[] = "Last name can't be empty";
// and so on
after you do all of this make statement to check if error array is empty, if not display errors
if (empty($error)) {
// do something
} else {
// error exists you want to display all errors
foreach ($error as $value) {
echo '<ul><li>'.$value.'</li></ul>';
}
}
in the html form, you have to add the attribute required in html tag and without using the PHP processing
First name <input name="name" type="text" required="required">
and if the user doesn't enter his First name, he will get the error message (that the first name is required)
It is echoing to the other page but not sending to the database. There is a php page just for to connect to the database.So I took off the connection to the database in this php page but got alot of errors.
This is the code:
<?php
require 'login.php';
$path = 'img/';
if (isset($_POST['submit'])) {
// Grab the image from the POST array
$fn = isset($_POST['fname']) ? $_POST['fname'] : '';
$ln = isset($_POST['lname']) ? $_POST['lname'] : '';
$sex = isset($_POST['sex']) ? $_POST['sex'] : '';
$city = isset($_POST['city']) ? $_POST['city'] : '';
$em = isset($_POST['email']) ? $_POST['email'] : '';
$pass = isset($_POST['pword']) ? $_POST['pword'] : '';
$confirm = isset($_POST['cword']) ? $_POST['cword'] : '';
//$gend = $_POST['gender']; not using now
$pic = $_FILES['pic']['name'];
if (!empty($fn) && !empty($ln) && !empty($pic)) {
// Move the file to the target upload folder
$target = $path.$pic;//create image source (src)
if (move_uploaded_file($_FILES['pic']['tmp_name'], $target)) {
// // Connect to the database
$dbase = mysqli_connect('localhost', 'root', '', 'flowers');
//Write the data to the database
$my_query = "insert into members values ('$fn', '$ln', '$sex','$city','$em','$pass', '$pic');";
mysqli_query($dbase, $my_query);
// Confirm success with the user
echo '<p>Thank you for registering with us!</p>';
echo '<p><strong>Name:</strong> ' . $fn .' '.$ln .'<br />';
echo '<img src="' . $path . $pic . '" alt="profile image" /></p>';
echo '<p><< Return to home page</p>';
}
}
}
form code:
<div id="formControl">
<form id="form" action="img_upload.php" method="post" onsubmit="return validateForm(); "enctype="multipart/form-data">
<fieldset>
<legend>Personal Information</legend>
<label> First Name: </label> <br/>
<input type="text" id="fname" name="fname"/> <br/>
<span id="f_error"></span><br/><br/>
<label>Last Name </label><br/>
<input type="text" name="lname" id="lname"/><br/><br/>
<span id="l_error"></span><br/>
<label> Sex: </label><br/>
Male <input type="radio" id="msex" name="sex" value="Male"/>
Female <input type="radio" id="fsex" name="sex" value="female"/> <br/> <br/> <br/>
<label>City: </label>
<select>
<option value="" selected="selected" name="city" id="add">Select a City</option>
<option value="sando">San Fernando</option>
<option value="pos">Port of Spain</option>
<option value="chag">Chaguanas</option>
<option value="arima">Arima</option>
<option value="bella">Marabella.</option>
<option value="point">Point Fortin</option>
<option value="puna">Tunapuna</option>
<option value="scarborough">Scarborough</option>
</select>
<span id="ad_error"></span><br/><br/>
</fieldset>
<fieldset>
<legend>Register</legend>
<label>Email Address</label><br/>
<input type="text" id="email" name="email"/><br/><br/>
<span id="em_error"></span><br/><br/>
<label> Password: </label><br/>
<input type="password" id="pword" name="pword"/> <br/> <br/>
<span id="p_error"></span><br/><br/>
<label>Confirm Password: </label><br/>
<input type="password" id="cword" name="cword"/> <br/> <br/>
<span id="c_error"></span><br/>
<label>Profile Picture: </label><br/>
<input type="file" name="pic" id = "pic" /><br/> <br/> <br/>
<input type="submit" name="submit" value="Submit"/>
<input type="reset" value="Reset"/>
</fieldset>
</form>
</div>
Please check $dbase link after connect to database.
after it check error code.
also you can echo your sql Query to know what sending to database and to valuate that, copy it and execute in direct in your mysql database
Make sure that the column count of your table matches with the amount of values you are inserting.
I noticed you didn't use the $gend variable, yet it may be a column in your table.
Auto-incrementing fields will be set default on +1 each new entry. I tested a similar query and I encountered the following error:
#1136 - Column count doesn't match value count at row 1
This is a form that I get the user to enter data including their mobile number and mobile carrier. I am using concatenation of the mobile number and carrier to send a message to their phone. This works but I am having a problem with the concatenation for the email recipient. If I use a straight email address ("myemail#gmail.com"), it will deliver the content. It will not work using the concatenation of $phone and $carrier ($YourEmailAddress). I have tried several different methods but nothing is working. I have tried using "&" and "+". I need assistance in figuring out why the concatenation of the phone and carrier strings is not working. I am new to this site so I am not sure if I correctly posted this.
This is my php file:
<?php
if( count($_POST) )
{
$YourEmailSubject = "Form Submission From the Blog";
$name = stripslashes($_POST['name']);
$email = stripslashes($_POST['email']);
$comment = stripslashes($_POST['comment']);
$phone = ($_POST['phone']);
$selectOption = $_POST['carrier'];
$content = "$name\r\n$email\r\n$comment\r\n$selectOption\r\n";
$YourEmailAddress = $phone."#".$selectOption;
mail($YourEmailAddress,$YourEmailSubject,$content,"From: ABC Company");
header("Location:" . (isset($_POST['redirect']) ? $_POST['redirect'] : '/') );
exit;
}
?>
This is my form:
<form method="post" action="/simplecontact.php">
<input type="hidden" name="redirect" value="//www.google.com">
<p>
Name:<br>
<input type="text" name="name" style="width:200px;"></td>
</p>
<p>
Email:<br>
<input type="text" name="email" style="width:200px;"></td>
</p>
<p>
Comment:<br>
<textarea name="comment" style="width:200px; height:100px"></textarea></td>
</p>
<p>Phone Number:<br>
<input type="text" id="number" name="number" /></td>
</p>
Carrier: <br>
<select id="carrier" name="carrier">
<option value="tmomail.net">T-mobile</option>
<option value="vmobl.com">Virgin Mobile</option>
<option value="cingularme.com">Cingular</option>
<option value="messaging.sprintpcs.com">Sprint</option>
<option value="txt.att.net">AT&T</option>
<option value="vtext.com">Verizon</option>
<option value="messaging.nextel.com">Nextel</option>
<option value="email.uscc.net">US Cellular</option>
<option value="sms.mycricket.com">Cricket</option>
<option value="mymetropcs.com">Metro PCS</option>
<option value="myboostmobile.com">Boost Mobile</option>
</select>
<p>
<input type="submit" style="width:200px;" value="Submit Form"></td>
</p>
</form>
In your form the phone input name is "number", in the php code you are trying to get the phone number like the input name was "phone"
Just change the input name to "phone"
<input type="text" id="number" name="phone" /></td>
i know this topic has been touched on so much, but a solution is still evading me. I keep getting an unidentified index error in this php file:
<?php
$name = isset($_POST['name']) ? $_POST['name'] : '';
$telephone = isset($_POST['telephone']) ? $_POST['telephone'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$birthDate = isset($_POST["birthDate"]) ? $_POST['birthDate'] : '';
$gender = isset($_POST['gender']) ? $_POST['email'] : '';
$comments = isset($_POST['comments']) ? $_POST['comments'] : '';
?>
Thanks for submitting your application!<br>
The following is the information we received:<br>
Name: <?php echo $_POST['name'] ?><br>
Telephone: <?php echo $_POST['telephone']?><br>
E-Mail: <?php echo $_POST['email']?><br>
Birthday: <?php echo $_POST['birthDate '] ?><br>
Gender: <?php echo $_POST['gender'] ?><br>
When you first wanted to be a zookeeper: <?php echo $_POST['comments ']
?>
</body>
</html>
here's the html form that this php file is getting it's values from:
<form id="zooKeeperForm" action="zoo.php" method="GET" onsubmit="return validateForm()">
<p><i>Please complete the form. Mandatory fields are marked with a </i><em>*</em></p>
<fieldset>
<legend>Contact Details</legend>
<label for="name">Name <em>*</em></label>
<input id="name" placeholder="Jane Smith" autofocus required><br>
<label for="telephone">Telephone</label>
<input id="telephone" placeholder="(xxx) xxx-xxxx"><br>
<label for="email">Email <em>*</em></label>
<input id="email" type="email" required><br>
</fieldset>
<fieldset>
<legend>Personal Information</legend>
<label for="birthDate">Birth Date<em>*</em></label>
<input id="birthDate" type="date" required><br>
<label for="age">Age<em>*</em></label>
<input id="age" type="number" min="0" max="120" step="0.1" required><br>
<label for="gender">Gender</label>
<select id="gender">
<option value="female">Female</option>
<option value="male">Male</option>
</select><br>
<label for="comments">When did you first know you wanted to be a zoo-keeper?<em>*</em></label>
<textarea id="comments" oninput="validateComments(this)" required></textarea>
</fieldset>
<p><input type="submit" value="Submit Application"></p>
</form>
what am I doing wrong here?? I feel like an idiot. I keep going from getting the unidentified index error to where it prints out the format I want but it's just blank for all the values that should be getting plugged in.
First thing:
Change it to POST
<form id="zooKeeperForm" action="zoo.php" method="POST" onsubmit="return validateForm()">
// ^ POST not GET
Second. Name attributes is the one to be used not ids
<input id="name" placeholder="Jane Smith" autofocus required>
// NOT ID but name="name"
This must be:
<input name="telephone" placeholder="(xxx) xxx-xxxx" id="telephone" />
<input name="email" type="email" required id="email" />
<input name="birthDate" type="date" required id="birthDate" />
<select name="gender" id="gender">
<textarea name="comments" oninput="validateComments(this)" id="comments" required>
Third:
The simple thing here is that, always process form input the form is submitted. Not upon initial load.
Catch the submission with something like this:
<input type="submit" name="zoo_submit" value="Submit Application" />
Then in PHP:
// simple initialization
$name = $telephone = $email = $birthDate = $gender = $comments = '';
if(isset($_POST['zoo_submit'])) {
$name = isset($_POST['name']) ? $_POST['name'] : '';
$telephone = isset($_POST['telephone']) ? $_POST['telephone'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$birthDate = isset($_POST["birthDate"]) ? $_POST['birthDate'] : '';
$gender = isset($_POST['gender']) ? $_POST['email'] : '';
$comments = isset($_POST['comments']) ? $_POST['comments'] : '';
}
?>
Thanks for submitting your application!<br>
The following is the information we received:<br>
<!-- now you have already set the variables above, use them, not the POST values again -->
Name: <?php echo $name; ?><br>
Telephone: <?php echo $telephone; ?><br>
E-Mail: <?php echo $email; ?><br>
Birthday: <?php echo $birthDate; ?><br>
Gender: <?php echo $gender; ?><br>
When you first wanted to be a zookeeper: <?php echo $comments; ?>