zomadlea Posted February 17, 2007 Share Posted February 17, 2007 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 More sharing options...
Archadian Posted February 17, 2007 Share Posted February 17, 2007 the file or folder that the script is in where you are getting the 403 Forbidden error you have to set the security options so that IUSR_%machinename% so that it has full acces to read, write and execute the script or the scripts in that particular folder. Link to comment https://forums.phpfreaks.com/topic/38865-403-forbidden-error/#findComment-186917 Share on other sites More sharing options...
zomadlea Posted February 17, 2007 Author Share Posted February 17, 2007 Hi, Thanks for your reply. I think I'll need a little more help though please. 1. The only relevant folders that I know of are c:\wamp and c:\windows the permissions on those are read\write Are there other folders I need to look at. Thanks Jeff Link to comment https://forums.phpfreaks.com/topic/38865-403-forbidden-error/#findComment-186923 Share on other sites More sharing options...
zomadlea Posted February 17, 2007 Author Share Posted February 17, 2007 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 More sharing options...
redarrow Posted February 17, 2007 Share Posted February 17, 2007 i tested your code it's fine what wrong? Link to comment https://forums.phpfreaks.com/topic/38865-403-forbidden-error/#findComment-186942 Share on other sites More sharing options...
Archadian Posted February 17, 2007 Share Posted February 17, 2007 The problem is with his windows security setup on that folder with the scripts. Link to comment https://forums.phpfreaks.com/topic/38865-403-forbidden-error/#findComment-186968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.