403 Forbidden
Posted: Mon Apr 09, 2007 12:35 pm
Hello,
I am new to PHP. I have installed wampserver. What I am trying to do is create a simple shoutbox.
This is the code I currently have;
When I go to http://localhost, and select the php page it allows this, but when I hit the submit button I get a 403 forbidden error, You don't have permission to access /test/< on this server.
As far as I am aware I have everything set up right.
Any help towards fixing this would be much appreciated, thanks, Stann.
I am new to PHP. I have installed wampserver. What I am trying to do is create a simple shoutbox.
This is the code I currently have;
Code: Select all
<?
//the host, name, and password for your mysql
mysql_connect("localhost","root","password");
//select the database
mysql_select_db("shoutbox");
if($submit)
{
//use the PHP date function for the time
$time=date("h:ia d/j/y");
// inserting it into the shoutbox table which we made in the mysql statements before
$result=MYSQL_QUERY("INSERT INTO shoutbox (ID,name,message,time)".
"VALUES ('NULL','$name', '$message','$time')");
}
?>
<?
//returning the last 5 messages
$result = mysql_query("select * from shoutbox order by ID desc limit 5");
//the while loop
while($r=mysql_fetch_array($result))
{
//getting each variable from the table
$time=$r["time"];
$ID=$r["ID"];
$message=$r["message"];
$name=$r["name"];
?>
<? echo $time ?><br>
<? echo $name ?><br>
<? echo $message ?><br>
<? } ?>
<form action="<? echo $php_self ?>" method="post">
<INPUT TYPE='TEXT' value='name' NAME='name' SIZE=30 maxlength='100'><br>
<INPUT TYPE='TEXT' value='message' NAME='message' SIZE=30 maxlength='100'>
<input type="submit" name="submit" value="submit">
</form>As far as I am aware I have everything set up right.
Any help towards fixing this would be much appreciated, thanks, Stann.