I am trying to request form elements from a form from a page that
looks like this:
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form action="result. php" method="post">
Name: <input type="text" name="username" value="brenda"> <br />
Email: <input type="text" name="email" value="hipples" ><br />
<input type="submit" name="submit" value="Submit me!">
</form>
</body>
</html>
Here is the results page, using multiple methods of variable retreival
and it will not work locally but up on the web server it works
fine....
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<?php
// Available since PHP 4.1.0
echo $_POST['username'];
echo $_REQUEST['username'];
import_request_ variables('p', 'p_');
echo $p_username;
// Available since PHP 3. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_a rrays directive.
echo $HTTP_POST_VARS['username'];
// Available if the PHP directive register_global s = on. As of
// PHP 4.2.0 the default value of register_global s = off.
// Using/relying on this method is not preferred.
echo $username;
?>
</body>
</html>
When I view the source of the result.php page, the opening <HTML> is
never there, leading me to beleive that there is a header issue of
some sort. Can anyone out there explain this behavior? Thanks alot,
Shannon
looks like this:
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<form action="result. php" method="post">
Name: <input type="text" name="username" value="brenda"> <br />
Email: <input type="text" name="email" value="hipples" ><br />
<input type="submit" name="submit" value="Submit me!">
</form>
</body>
</html>
Here is the results page, using multiple methods of variable retreival
and it will not work locally but up on the web server it works
fine....
<html>
<head>
<title>Untitl ed Document</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body>
<?php
// Available since PHP 4.1.0
echo $_POST['username'];
echo $_REQUEST['username'];
import_request_ variables('p', 'p_');
echo $p_username;
// Available since PHP 3. As of PHP 5.0.0, these long predefined
// variables can be disabled with the register_long_a rrays directive.
echo $HTTP_POST_VARS['username'];
// Available if the PHP directive register_global s = on. As of
// PHP 4.2.0 the default value of register_global s = off.
// Using/relying on this method is not preferred.
echo $username;
?>
</body>
</html>
When I view the source of the result.php page, the opening <HTML> is
never there, leading me to beleive that there is a header issue of
some sort. Can anyone out there explain this behavior? Thanks alot,
Shannon