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
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

Link to comment
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

 

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

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.