Hello.
I am a beginner to PHP and I am currently just going through a book,
to create a simple form page. Unfortunately it doesn't work, and
there is nothing listed on the books errata page on the internet.
I wondered if you can just help me with it?
It is just a form that you type your name in on the test_form.php
page, and then on the test_form_proce ssor.php page it is supposed to
say Thank you, yourname, for completing the form. It doesn't display
the name you type in though.
Below is a copy of the code for the two pages:
test_form.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<form name="frm_name" id="frm_name" method="post"
action="test_fo rm_processor.ph p">
First Name
<input name="firstName " type="text" id="firstName" />
</form>
</body>
</html>
test_form_proce ssor.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<p>Thank you, <?php echo $_POST['firstName']; ?>, for filling out my
form.
</p>
</body>
</html>
Thanks very much for any help you can offer.
John
I am a beginner to PHP and I am currently just going through a book,
to create a simple form page. Unfortunately it doesn't work, and
there is nothing listed on the books errata page on the internet.
I wondered if you can just help me with it?
It is just a form that you type your name in on the test_form.php
page, and then on the test_form_proce ssor.php page it is supposed to
say Thank you, yourname, for completing the form. It doesn't display
the name you type in though.
Below is a copy of the code for the two pages:
test_form.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<form name="frm_name" id="frm_name" method="post"
action="test_fo rm_processor.ph p">
First Name
<input name="firstName " type="text" id="firstName" />
</form>
</body>
</html>
test_form_proce ssor.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitl ed Document</title>
</head>
<body>
<p>Thank you, <?php echo $_POST['firstName']; ?>, for filling out my
form.
</p>
</body>
</html>
Thanks very much for any help you can offer.
John
Comment