Forum Moderators: coopster

Message Too Old, No Replies

Forbidden Message

         

lisa_alias

6:14 am on Feb 5, 2004 (gmt 0)

10+ Year Member



why does this type of message appears?
what do i have to do to fix this?

thanks.

Forbidden
You don't have permission to access /intan/online3112/<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>d:/apache group/apache/htdocs/intan/online3112/la_addnewsite.php</b> on line <b>261</b><br /> on this server.

mykel79

11:07 am on Feb 5, 2004 (gmt 0)

10+ Year Member



What were you trying to do when you got this message? Submit a form maybe?
If so, it seems you used the variable PHP_SELF but it did not work and was empty. Therefore the script tried to access the directory its in instead of the file (who's name should have been in the variable).
Try to replace PHP_SELF with the name of the file and see if it works.

coopster

12:42 pm on Feb 5, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, lisa_alias!

You probably missed something easy like a quotation mark or perhaps your spelled $SERVER as opposed to $_SERVER:


$_SERVER['PHP_SELF']

At least PHP has given you somewhere to start...check the syntax of line 261 in your script.

lisa_alias

4:49 am on Feb 6, 2004 (gmt 0)

10+ Year Member



thanks guys for your replies..

actually, the story is like this:
i have copied the original php files (my programs) into another pc and run them. the 2nd pc is already installed with apache 1.3.23 and mysql for win32. it doesn't work like it should be (it works fine in 1st pc). after i run them in the 2nd pc, one of the errors is:

Notice: Undefined variable: rowP in d:\apache group\apache\htdocs\latest_060204\online3112\mam_display_existingsite2.php on line 233

and most of the errors are regarding to undefined variables, including the PHP_SELF. (fyi, $rowP = mysql_fetch_array($db)).

the difference between the 1st and 2nd pc is the location of where Apache is installed (1st pc in C:/ and 2nd pc is in D:/). but i guess it is not the matter of where the apache is installed, right?

what's going on? what do i have to do?

mykel79

9:13 am on Feb 6, 2004 (gmt 0)

10+ Year Member



As far as rowP is concerned, is mySQL working correctly on the second PC?

Like coopster said, try replacing PHP_SELF with $_SERVER['PHP_SELF']. It depends on the server configuration how you can access this variable, sometimes you need to do it through $_SERVER['PHP_SELF'] (and sometimes just through $PHP_SELF).

coopster

12:57 pm on Feb 6, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Since you've had the code running fine on one server but the issues start after porting it to a new server it leads me to believe that this is more than likely differences in configuration.

It looks as if you are only receiving notice errors so the first thing I would check is the PHP error_reporting level. Second, register_globals. You'll find both directives in the php.ini and both can be overridden. There is a PHP Troubleshooting [webmasterworld.com] tip on error_reporting in the PHP Forum Library. There is an overview and plenty of links to help you understand how PHP reports errors.