BlindPilot
06-17-05, 06:20 AM
Hi,
Im trying to teach myseld PHP, but think I may have hit a snag..
Ive made a form which passes data onto a PHP page.
I know the code is working on the form, as if I set its method to get I can see the correct data being passed along in the URL.
However, my php page is telling me that the variables are undefined.
THe tutorial ive used doesnt mention anything about this and seems to assume that the variables, in this case:
UserName
and
UserChoice
will be picked up automatically by my variables in the PHP:
$UserName
$UserChoice
Ive checked to make sure all cases / spellings are correct.
My HTML page looks like this:
<html>
<head>
<title>My Form</title>
</head>
<body>
<form action="formerphp.php" method=post>
User name:
<br> <input type="text" name="UserName">
<p> Desired nickname:
<br> <input type="text" name="UserChoice">
<p>
<input type="submit" name="submit" value="Enter My Data!">
</form>
</body>
</html>
The php is this:
<html>
<head>
<title>Choices.</title>
</head>
<body>
<p>
Hi <?php print $UserName; ?>
<p>
Nickname: <b> <?php print $UserChoice; ?> !?! </b>
</body>
</html>
any ideas where im going wrong?
Could it be something to do with the set-up of my PHP-IIS jobby??
Im trying to teach myseld PHP, but think I may have hit a snag..
Ive made a form which passes data onto a PHP page.
I know the code is working on the form, as if I set its method to get I can see the correct data being passed along in the URL.
However, my php page is telling me that the variables are undefined.
THe tutorial ive used doesnt mention anything about this and seems to assume that the variables, in this case:
UserName
and
UserChoice
will be picked up automatically by my variables in the PHP:
$UserName
$UserChoice
Ive checked to make sure all cases / spellings are correct.
My HTML page looks like this:
<html>
<head>
<title>My Form</title>
</head>
<body>
<form action="formerphp.php" method=post>
User name:
<br> <input type="text" name="UserName">
<p> Desired nickname:
<br> <input type="text" name="UserChoice">
<p>
<input type="submit" name="submit" value="Enter My Data!">
</form>
</body>
</html>
The php is this:
<html>
<head>
<title>Choices.</title>
</head>
<body>
<p>
Hi <?php print $UserName; ?>
<p>
Nickname: <b> <?php print $UserChoice; ?> !?! </b>
</body>
</html>
any ideas where im going wrong?
Could it be something to do with the set-up of my PHP-IIS jobby??