devWhiz Posted April 22, 2011 Share Posted April 22, 2011 So, I've been compiling all of my scripts to .exe so no one can see my code and release it to other people without my permission so on my site I have place a script that, if I put a users IP in the script it will display their ip when they load the script this is the code for the script hosted on my site <?php $ADDRESS = $_SERVER['REMOTE_ADDR']; if(stristr($ADDRESS, '00.000.000.000') || stristr($ADDRESS, '123.456.16.548')) { echo $ADDRESS; }else{ echo "NOT AUTHORIZED TO VIEW THIS PAGE"; } ?> so if the persons IP address is not 00.000.000.000 or 123.456.16.548 it will not display their IP so on the script I made this code <?php $ip = file_get_contents('script URL'); if(stristr($ip, '123.456.16.548')) { echo "Script can begin...."; // CODE HERE // }else { echo "you are not authorized to use this script"; } ?> when the script is in .exe form they cannot edit the link or the IP that is in the script.. and if someone sends it out I can take their IP off of the if statement in the script on my site and it wont display their ip for the script the verify Is this good or is there a better way to do this? mysql doesnt work well when the script is encoded, otherwise I would have use mysql Quote Link to comment https://forums.phpfreaks.com/topic/234421-better-way-to-pretect-a-script/ Share on other sites More sharing options...
joquius Posted April 22, 2011 Share Posted April 22, 2011 I'm trying to understand what "code" you're referring to, because obviously PHP is preprocessed so the client won't see it. Quote Link to comment https://forums.phpfreaks.com/topic/234421-better-way-to-pretect-a-script/#findComment-1204785 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.