473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Jul 16 '05 #1
3 4463
On 8 Jul 2003 04:07:45 -0700, Gabriel hath writ:

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.


.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
Jul 16 '05 #2
>
.htaccess

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

Jonesy


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

/Gabriel
Jul 16 '05 #3
On 9 Jul 2003 10:05:26 -0700, Gabriel hath writ:

.htaccess

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

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

/Gabriel


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
Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: dave | last post by:
Hello, I'm creating a site that has several contact email addresses. These are vlid addresses, i'm wondering if i can use php to alter these addresses so that spam harvesters can't get them, yet a...
9
by: toufik toufik | last post by:
Hi, Is it possible to hide a source code PHP in order to protect it, I mean, I'm developpind a web solution for customers and I don't like that the customer or the host see my code. Thanks.
2
by: lkrubner | last post by:
Suppose I let users login into my control panel and upload files. They could upload PHP or Python or Perl scripts and take over the web server. If the PHP code that handles the uploads...
5
by: frankarturi | last post by:
I have a members area full of video clips. Clips are inside /hide/videoclips/ and /hide is apache protected directory by .htaccess Users can enter by a login.php (entering user and password)...
15
by: Fady Anwar | last post by:
Hi while browsing the net i noticed that there is sites publishing some software that claim that it can decompile .net applications i didn't bleave it in fact but after trying it i was surprised...
1
by: drelliot | last post by:
What's the best way to protect/track php software with licenses and remote detection of who is runnng it? There's Zend safeguard, but how else do people do this? ...
7
by: howa | last post by:
if speed, size is not a matter, i just want to protect the code as much as possible, any library or tools do you think is the best solution right now? i know there is not a perfect solution, but...
6
by: Alucard | last post by:
Hi all. I would like to ask if Regular expression is the best way to deal with SQL injection attack, and no mysql_real_escape_string() is used: if(preg_match("(4,6)")){ print "Success!"; } ...
3
by: flyingbear | last post by:
I'm a newbie of php: how to protect php code? I mean the php code is on the server, is it easy for others to get the source code from server? is it possible to encode the source code? thanks ...
3
by: Sin Jeong-hun | last post by:
It seems like the Protect() uses the Windows accout information to encrypt data. If I know the user name and the password, can I decrypt it on another PC? If it is not, how about the exported key?...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.