Connect with Expertise | Find Experts, Get Answers, Share Insights

How do I protect my PHP-script from unauthorized access?

Gabriel
 
Posts: n/a
#1: Jul 16 '05
Hello everybody.

I have a question about how to protect my PHP-script from all
unauthorized access. I have a PHP-script on my web server and this
PHP-script should only be accessible from _one_ IP-address.

Right now I am using "$_SERVER['REMOTE_ADDR']" to check if the person
that wishes to access my PHP-script is authorized or not but I believe
that this is quite easily circumvented…

Are there other ways to prevent anyone from accessing my PHP-script
(except the from the one IP-address that is authorized)?? Is there
maybe a way to do this with a firewall? I am using Linux on the server
by the way.

Kindly
Gabriel

Allodoxaphobia
 
Posts: n/a
#2: Jul 16 '05

re: How do I protect my PHP-script from unauthorized access?


On 8 Jul 2003 04:07:45 -0700, Gabriel hath writ:[color=blue]
>
> I have a question about how to protect my PHP-script from all
> unauthorized access. I have a PHP-script on my web server and this
> PHP-script should only be accessible from _one_ IP-address.
>
> Right now I am using "$_SERVER['REMOTE_ADDR']" to check if the person
> that wishes to access my PHP-script is authorized or not but I believe
> that this is quite easily circumvented…
>
> Are there other ways to prevent anyone from accessing my PHP-script
> (except the from the one IP-address that is authorized)?? Is there
> maybe a way to do this with a firewall? I am using Linux on the server
> by the way.[/color]

.htaccess

|<files special-secret-secure.php>
|order deny,allow
|deny from all
|allow from 999.999.999.999
|</files>

Jonesy
--
| Marvin L Jones | jonz | W3DHJ | OS/2
| Gunnison, Colorado | @ | Jonesy | linux __
| 7,703' -- 2,345m | config.com | DM68mn SK
Gabriel
 
Posts: n/a
#3: Jul 16 '05

re: How do I protect my PHP-script from unauthorized access?


>[color=blue]
> .htaccess
>
> |<files special-secret-secure.php>
> |order deny,allow
> |deny from all
> |allow from 999.999.999.999
> |</files>
>
> Jonesy[/color]

That did the trick! Thank you both for your answers. Goldstars will be
rewarded to you :)

/Gabriel
Allodoxaphobia
 
Posts: n/a
#4: Jul 16 '05

re: How do I protect my PHP-script from unauthorized access?


On 9 Jul 2003 10:05:26 -0700, Gabriel hath writ:[color=blue][color=green]
>>
>> .htaccess
>>
>> |<files special-secret-secure.php>
>> |order deny,allow
>> |deny from all
>> |allow from 999.999.999.999
>> |</files>
>>[/color]
> That did the trick! Thank you both for your answers. Goldstars will be
> rewarded to you :)
>
> /Gabriel[/color]

It's not often that I am of much help to anyone.
Kinda brightens my day when I am.
Glad to help.
Jonesy
--
| Marvin L Jones | jonz | W3DHJ | OS/2
| Gunnison, Colorado | @ | Jonesy | linux __
| 7,703' -- 2,345m | config.com | DM68mn SK
Closed Thread