I have a PHP script on my index.php file and I want this script to be executed ONLY when I access index.php file from my computer (which is at home). I want this PHP script NOT to be executed when someone else access index.php file from another machine.
My problem is that I don`t know how to do this. I was thinking to use the IP addresse of my computer but, unfortunately, it is dinamyc. So, every time when I get on the Internet I have a completely different IP addresse. It would work only if the IP addresse would be static.
In this moment I have no idea and I wonder if someone can give a tip.
PHP script executed only from a certain machine
Moderator: General Moderators
-
AccesInterzis
- Forum Newbie
- Posts: 4
- Joined: Wed Nov 25, 2009 4:00 am
Re: PHP script executed only from a certain machine
You could require a parameter to be added to the url... index.php?is_me=1 and then only do what you want if ($_GET['is_me'] == 1)