discus
08-08-2005, 02:07 PM
Hello,
Could you help me with this problem please?
In which way should I use the following 2 scripts:
Listing 10-2: A simple form
<html>
<head>
<title>Listing 10-2</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040">
<form action="listing10-3.php" method="post">
<b>Give us some information!</b><br>
Your Name:<br>
<input type="text" name="name" size="20" maxlength="20" value=""><br>
Your Email:<br>
<input type="text" name="email" size="20" maxlength="40" value=""><br>
<input type="submit" value="go!">
</form>
</body>
</html>
Listing 10-3: Displaying the data collected in Listing 10-2
<html>
<head>
<title>Listing 10-3</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040">
<?
// output the user's name and email address.
print "Hi, $name!. Your email address is $email";
?>
</body>
</html>
I've saved them as a 2 php files, listing10-2.php and listing10-3.php in my localhost folder.
I've called listing10-2.php through my localhost, and have got the form.
When I fill the form and press the 'go!' button, I get "Hi, !. Your email address is".
So why the variables $name and $email haven't been passed ?
Thanks
Could you help me with this problem please?
In which way should I use the following 2 scripts:
Listing 10-2: A simple form
<html>
<head>
<title>Listing 10-2</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040">
<form action="listing10-3.php" method="post">
<b>Give us some information!</b><br>
Your Name:<br>
<input type="text" name="name" size="20" maxlength="20" value=""><br>
Your Email:<br>
<input type="text" name="email" size="20" maxlength="40" value=""><br>
<input type="submit" value="go!">
</form>
</body>
</html>
Listing 10-3: Displaying the data collected in Listing 10-2
<html>
<head>
<title>Listing 10-3</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#cbda74" vlink="#808040"
alink="#808040">
<?
// output the user's name and email address.
print "Hi, $name!. Your email address is $email";
?>
</body>
</html>
I've saved them as a 2 php files, listing10-2.php and listing10-3.php in my localhost folder.
I've called listing10-2.php through my localhost, and have got the form.
When I fill the form and press the 'go!' button, I get "Hi, !. Your email address is".
So why the variables $name and $email haven't been passed ?
Thanks