coolcamo8642
08-27-2009, 12:10 AM
I'm working on a script which [is supposed to] submit a form to itself, process data, and display it.
I've watered down the code to the form-specific elements:
<?php
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Form Test</title>
</head>';
if ($_GET['act'] == "Submit") {
$_POST["Text"];
}
echo'
<body>
<form action="test.php?act=Submit" method="post" name="Test">
<input name="Text" type="text" />
<input name="submit" type="submit" />
</form>';
echo '<p>'; echo $Text; echo '</p>';
echo'
</body>
</html>';
?>
In theory, that script should show whatever's entered into the text field in a paragraph after submission. But it doesn't. I've been pondering over this for some time and have yet to find a viable explanation. The code that this was derived from has worked in the past, however, right now I'm only testing it on a localhost setup.
Any input would be appreciated.
I've watered down the code to the form-specific elements:
<?php
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Form Test</title>
</head>';
if ($_GET['act'] == "Submit") {
$_POST["Text"];
}
echo'
<body>
<form action="test.php?act=Submit" method="post" name="Test">
<input name="Text" type="text" />
<input name="submit" type="submit" />
</form>';
echo '<p>'; echo $Text; echo '</p>';
echo'
</body>
</html>';
?>
In theory, that script should show whatever's entered into the text field in a paragraph after submission. But it doesn't. I've been pondering over this for some time and have yet to find a viable explanation. The code that this was derived from has worked in the past, however, right now I'm only testing it on a localhost setup.
Any input would be appreciated.