Page 1 of 1

PHP script executed only from a certain machine

Posted: Wed Nov 25, 2009 4:14 am
by AccesInterzis
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.

Re: PHP script executed only from a certain machine

Posted: Wed Nov 25, 2009 4:23 am
by Virvo
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)