The following cod,when I press the SUBMIT button , I get "Forbidden, You don't have permission to access /< on this server."
<html>
<head>
<title> The Internet Joke Database </title>
</head>
<body>
<?php
if (isset($_GET['addjoke'])): // If the user wants to add a joke
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<p>Type your joke here:<br />
<textarea name="joketext" rows="10" cols="40" wrap>
</textarea><br />
<input type="submit" name="submitjoke" value="SUBMIT" />
</p>
</form>
<?php
else: // Default page display
// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');
if (!$dbcnx) {
die( '<p>Unable to connect to the ' .
'database server at this time.</p>' );
}
// Select the jokes database
if (! @mysql_select_db('jokes') ) {
die( '<p>Unable to locate the joke ' .
'database at this time.</p>' );
}
// If a joke has been submitted,
// add it to the database.
if (isset($_POST['submitjoke'])) {
$joketext = $_POST['joketext'];
$sql = "INSERT INTO Jokes SET
JokeText='$joketext',
JokeDate=CURDATE()";
if (@mysql_query($sql)) {
echo('<p>Your joke has been added.</p>');
} else {
echo('<p>Error adding submitted joke: ' .
mysql_error() . '</p>');
}
}
echo('<p> Here are all the jokes in our database: </p>');
// Request the text of all the jokes
$result = @mysql_query('SELECT JokeText FROM Jokes');
if (!$result) {
die('<p>Error performing query: ' .
mysql_error() . '</p>');
}
// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) ) {
echo('<p>' . $row['JokeText'] . '</p>');
}
// When clicked, this link will load this page
// with the joke submission form displayed.
echo('<p><a href="' . $_SERVER['PHP_SELF'] .
'?addjoke=1">Add a Joke!</a></p>');
endif;
?>
</body>
</html>
The funny thing is that 2 month ago,the same code , on the same machine worked.
Now I tried on a different pc,I install/unistall dozens of wamp versions , I don't have a clue what could be wrong
As the code says,I'm running it on the same computer ( localhost )