PHP Form that inserts data into database that expires over 1 month

So this is what I need to do. I would like to develop a basic PHP form with fields for putting in information that is submitted to a database. This form does not have to have any styling whatsoever, I can do that all myself. Once the information is submitted to the SQL database, that information will expire after 1 month. Also, before the information is submitted, the user is redirected to a PayPal payment page, after which the information is submitted after payment confirmation. It seems like a pretty hefty request to me, but I am a complete beginner and need some serious help with it. I need some help from step 0 to finish.

The form fields:
“Steam ID:” name=“id” field type=text
“Donator Email:” name=“user_email” field type=text

name=“authtype” field type=hidden with value “steam”
name=“flags” field type=hidden with value “o”
name=“immunity” field type=hidden with value “0”
name=“identity” field type=hidden with value “donator”

Please remember that I am complete beginner, and I have to start from the basics. Thanks to anyone in advance! :smiley:

As far as having the data in your database expire after a certain amount of time, you achieve that through your web server’s cron jobs. Cron jobs are scripts that are activated by the server at the interval time that you set when you create one. I advise you to look into cron jobs for more information.

You would create a cron job to look into your database and run a command. You would then have to create an extra column in your database that you would fill in at the time you put your information in your database and fill that column with the date (and time) that you wish it to expire. When the cron job script is working, it would run through the MySQL syntax to delete the information:


WHERE <time_expire_column> <= <current_time>

You would have the script ask the MySQL server to delete from the table you created where the value in time that is in your extra column is less-than or equal to the current time. (I’m not that big on cron jobs so you would have to find out how to grab the current time. As far as I know this is the only way to automatically do anything on a web server. You can set cron jobs to run daily at a certain time.

As far as the PayPal question, PayPal can allow you to set it up where it will return to a specific page where you can then add your information to your database. Hope this helps!!!

Sponsor our Newsletter | Privacy Policy | Terms of Service