I have this code on one page, which works:
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>';
?>
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name" /></p>
<p>Your age: <input type="text" name="age" /></p>
<p><input type="submit" /></p>
</form>
<?php echo $_SERVER['HTTP_USER_AGENT'];echo '<br />';
?>
<?php
if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE') !== FALSE)
{
echo 'You are using Microsoft Internet Explorer.<br />';
}
?>
<?php phpinfo();
?>
</body>
</html>
On the "Action.php" page, which works but with no variables:
Hi <?php echo htmlspecialchars($_POST['name']); ?>.
You are <?php echo (int)$_POST['age']; ?> years old.
Why are the variable values not transfered?
Brand new to PHP, need help
Moderator: General Moderators
Re: Brand new to PHP, need help
One potential problem I see is that the form specifies action.php but you're talking about Action.php
Re: Brand new to PHP, need help
Thanks for the reply, that was a typo. Good eye. However whatever was going on seems to have worked itself out. The values are now showing up. Could something have been cached?