Jump to content

403 Forbidden Error


zomadlea

Recommended Posts

Hi,

 

I am new to PHP (this is my first day). I am working through a tutorial on the basics.

 

I have installed mySQL, Apachea and PHP today and they pass all the tests in the tutorial to confirm that everyting is functioning correctly. However one of the examples returns the error 403 Forbidden. I have included the code below.

I imagine it is something to do with the settings in the php.ini file but I'm not sure where to start looking.

 

When I upload the code to my website it works fine so it is just a local problem. Any assisatance would be greatly appreciated.

 

Reagrds

Jeff Nicholson

 

******************** Example Code ****************

<html>

<head></head>

<body>

<?php

// if the "submit" variable does not exist

// form has not been submitted

// display initial page

if (!$_POST['submit'])

{

?>

<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

Enter a number: <input name="number" size="2">

<input type="submit" name="submit" value="Go">

</form>

<?php

}

else

{

// if the "submit" variable exists

// the form has been submitted

// look for and process form data

// display result

$number = $_POST['number'];

if ($number > 0)

{

echo 'You entered a positive number';

}

elseif ($number < 0)

{

echo 'You entered a negative number';

}

else

{

echo 'You entered 0';

}

}

?>

</body>

</html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/38865-403-forbidden-error/
Share on other sites

Update.

 

I logged into windows in safe mode and checked all the permissions to the c:\wamp and c:\windows. I set everything I could see to full control but I still have no joy on the Forbidden error.

 

This is the page which is in the address bar when the error occurrs:

 

    http://localhost/%3C?=$_SERVER['PHP_SELF']?>

 

Please help

 

Regards

Jeff

Link to comment
https://forums.phpfreaks.com/topic/38865-403-forbidden-error/#findComment-186927
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.