Jump to content

How to expire a PHP script... Please Help.


thomas_smith

Recommended Posts

Hi!

 

I am trying to create a trial of my php script for 7 days.

 

What php code can I use so that in 7 days the user will be directed to my payment page.

 

I know that there already is code that will expire the script on a certain day.

 

Well looking forward to your responses.

 

thomas

Link to comment
https://forums.phpfreaks.com/topic/186840-how-to-expire-a-php-script-please-help/
Share on other sites

I'm not aware of a method without using an encoding software, such as Zend or CodeCop. If you want to risk the (albeit minute) possibility of them cracking your code, you can encode it in base64 (base64_encode, base64_decode (including the 'expiry date') and use eval.

 

$code = "BBCCAA44FF[...]"; //whatever you encoded with base64_encode()
eval(base64_decode($code)); //Run the encoded code, including expiry section

I'm not aware of a method without using an encoding software, such as Zend or CodeCop. If you want to risk the (albeit minute) possibility of them cracking your code, you can encode it in base64 (base64_encode, base64_decode (including the 'expiry date') and use eval.

 

$code = "BBCCAA44FF[...]"; //whatever you encoded with base64_encode()
eval(base64_decode($code)); //Run the encoded code, including expiry section

 

Ya right now I am using SourceCop and had little to no response from them so I had to look around.

 

They posted something like this:

 


if(date("Y-m-d")>="2005-11-11"){
header("Location: error.php");
exit();
}

 

Hope this helps...

 

thomas

You can use this code, sourcecop encodes it right? Then it should expire at the date you specify. You may want to replace date() with $date='xx/yy/zz'.. if you wish to test if your code works (on the odd case your expiry does not function, to be safe)

You can use this code, sourcecop encodes it right? Then it should expire at the date you specify. You may want to replace date() with $date='xx/yy/zz'.. if you wish to test if your code works (on the odd case your expiry does not function, to be safe)

 

any way i can expire it in 7 days?

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.