Page 1 of 1

Create a temp page

Posted: Sun May 04, 2008 3:54 am
by html20009876
How to auto create a temp page and auto delete it after a few days?

My purpose is to submit the page's link to user email for downloading my software from it.
User must download the software in a few of days, otherwise the page will be deleted and downloading is invalid.

I need php or JavaScript code.

thanks

Re: Create a temp page

Posted: Sun May 04, 2008 5:10 am
by AXEmonster
what you need to do is store the links in a database

these links are in the user table and each user row has a column to hold the link for that download. The user row also holds an expiry date which when called by a script (or when the user logs in) the links would be deleted or scrambled (deleted is best)

does this make sense?

Re: Create a temp page

Posted: Sun May 04, 2008 6:04 am
by lafever
Or you can use filemtime() to get the last date of the file compare it to the current date by strtotime() and if it's greater than X days old unlink() the file and it will be deleted. Hope this helps some.