Hi, I am working my way through a book titled "How to Do Everything with PHP & MYSQL" and I am having a problem. Part of one script I am looking at returns an error: here it is:
<html>
<head>
<title></title>
</head>
<body>
<?php
if(!$_POST['submit'])
{
?>
<form method="post" action="<?=$_SERVER['PHP_SELF']; ?>">
Enter number of rows
<input name="rows" type="text" size="4">
and columns
<input name="columsn" type="text" size="4">
<input type="submit" name="submit" value="Draw Table">
</form>
<?php
}
else
{
?>
<?php
$rows = $_POST['rows'];
echo "You wanted" . $rows;
?>
<?php
}
?>
</body>
</html>
Forget the else section of the form - I have been playing with it. As I understand the script it checks if the form exists, if it doesn't it creates it, then once the form exists the else section is processed - the code suggested creates a table based on the user's form entries.
The form works fine - however, when I press submit the server returns an error
"Not Found
The requested URL /< was not found on this server."
Can anybody help me to understand this better.
Many thanks,
Keith Hulse