Hi all,
I know this isn't strictly MAMP - I'm trying to use the basic <?=$_SERVER['PHP_SELF']?> variable in the following script, or any script (copied them straight out of a book):
<html>
<head></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="columns" type="text" size="4">
<input type="submit" name="submit" value="Draw Table">
</form>
<?php
}
else
{
?>
<table border="1" cellspacing="5" cellpadding="0">
<?php
// set variables from form input
$rows = $POST['rows'];
$columns = $POST['columns'];
// loop to create rows
for ($r = 1; $r <= $rows; $r++)
{
echo "<tr>";
// loop to create columns
for ($c = 1; $c <= $columns; $c++)
{
echo "<td> </td>\n";
}
echo "</tr>\n";
}
?>
</table>
<?php
}
?>
</body>
</html>
The first part of the program loads, with a small form asking for number of rows and columns, but when I fill it in and press submit I get:
Not Found
The requested URL /< was not found on this server.
Apache/1.3.33 Server at havelock.local Port 80
with http://localhost/%3C?=$_SERVER['PHP_SELF']?%3E in the URL bar.
This happens whatever I use around it. Anybody got any ideas? I have Apache 1.3.3 and the latest MySQL and PHP 5 builds running on a MacBook Pro 17" (1 previous to current model).
Thanks
Edd