Forms and variables
I've started to teach my self php again this time seriously but I've got one small proble and that is
that when I pass a variable from a form to a nother script (doesn't matter whether it's POSTor GET)
it doesn't print in the browser. (see code below) I've checked phpinfo and all seems ok to me
rechecked the script in the book and my scripts and everything seems ok so I'm stumped! Any
suggestions would be appreciated (using foxserv for apache, php etc and maguma studio as the
editor)
<html>
<head>
<title>Form Results</title>
</head>
<body>
<FORM ACTION="handleform.php" METHOD="POST">
First Name:<input type="text" name="firstname" size="20"><br>
Last Name:<input type="text" name="lastname" size="20"><br>
E-mail Address:<input type="text" name="email" size="20"><br>
Comments:<BR>
<textarea name="comments" rows=5 cols=40 wrap="on"></textarea><BR>
<input type="submit" value="SUBMIT" name="submit">
</FORM>
</body>
</html>
<html>
<head>
<title>Title here!</title>
</head>
<body>
<?php
/* This page recieves and handles the data generated by "form.html"*/
echo "Your first name is $firstname.<br>";
echo "Your last name is $lastname.<br>";
echo "Your E-mail address is $email.<br>";
echo "This is what you had to say:<br>";
echo "$comments";
?>
</body>
</html>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
<FORM ACTION="text.php" METHOD="GET">
Who is your favourite author:<BR>
<input type="text" name="author" size="20">
<br>
<br>
<input type="submit" value="SUBMIT">
</FORM>
</body>
</html>
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>
<body>
Your favourite author is:
<?php
echo "$author";
?>
</body>
</html>
;):)
What ever makes life easy
__________________
What ever makes life easy
|