Create a temp page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
html20009876
Forum Newbie
Posts: 3
Joined: Sun May 04, 2008 3:42 am

Create a temp page

Post 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
AXEmonster
Forum Commoner
Posts: 34
Joined: Fri Sep 05, 2003 11:27 am
Location: newcastle UK

Re: Create a temp page

Post 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?
User avatar
lafever
Forum Commoner
Posts: 99
Joined: Sat Apr 05, 2008 2:03 pm
Location: Taylor, MI

Re: Create a temp page

Post 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.
Post Reply