Jump to content

Better way to pretect a script?


devWhiz

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/234421-better-way-to-pretect-a-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.