Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Running First PHP Program

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Running First PHP Program

Postby zorz » Sun Mar 23, 2003 9:26 am

Hello bright minds,

Was hoping one of you could give me a hand to get started. This is my first PHP program ever. I'm trying to install PHPGirl's US Weather script on my site.

Installation is done remotely by running install.php script. However, as soon as I open it via browser, I get "Access Denied" error message, caused by this code:
Code: Select all
if (!eregi("mod.php", $PHP_SELF)) { die ("Access Denied"); }

Why does it happen? Thank you!
zorz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sun Mar 23, 2003 9:13 am

Postby Xerpher » Sun Mar 23, 2003 5:44 pm

That code is a protection so that only the startup script can load that file. It is for both security and server processor power... it could cause your server to crash if there was too many undefined things in it.
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby zorz » Mon Mar 24, 2003 5:21 am

Ok, but why does it happen, why condition returns TRUE? I run the script which is the only file trying to access the file... How do I pass it?
zorz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sun Mar 23, 2003 9:13 am

Postby Xerpher » Mon Mar 24, 2003 10:00 am

Its basically checking to see if the url in the address bar contains "mod.php" since mod.php is the start script that would run it. If the url does not contain "mod.php" it won't work.
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby zorz » Mon Mar 24, 2003 9:31 pm

You are right, that script is actually an add-on to a module that I do not have, hence the error. Thank you!
zorz
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sun Mar 23, 2003 9:13 am


Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.