I've a Paypal IPN PHP script that creates an account in one table and then insert the transaction details into another table.
Three days after the account has been created/the payment has been recieved and the details has been inserted into the database I need the users to be able to go to a page and view their username and password by typing in their email and the auction ID (which are in the database).
I thought that I can create a new table where I insert the date, the username, the password and the auction ID when the account is created and then I can have a script that removes that row after three days (because the login and the transaction details are already saved in the other tables). In other words when the row has been deleted they can't get access to their passwords anymore by going to that page and typing in their username and password because the their email and auction ID aren't in that table anymore.
Basicly I need to know at least how to make the delete script delete the rows after three days.
I've asked for help on another forum but I can't get it to work, here is the codes I've (with help) done so far but it doesn work..
This is the PHP code that should add the date:
Code: Select all
//Connect to MySQL
mysql_connect("localhost", "test", "test") or die(mysql_error());
//Select file system database
mysql_select_db("test") or die(mysql_error());
$v = time();
mysql_query("INSERT INTO temp_users (invoice, receiver_email, item_name, item_number, quantity, payment_status, pending_reason, payment_date, mc_gross, mc_fee, tax, mc_currency, txn_id, txn_type, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_status, payer_email, payer_status, payment_type, notify_version, verify_sign, referrer_id, memo, for_auction, auction_buyer_id, auction_closing_date, auction_multi_item, account_username, account_password, `account_group`, account_email, date) VALUES('$invoice', '$receiver_email', '$item_name', '$item_number', '$quantity', '$payment_status', '$pending_reason', '$payment_date', '$mc_gross', '$mc_fee', '$tax', '$mc_currency', '$txn_id', '$txn_type', '$first_name', '$last_name', '$address_street', '$address_city', '$address_state', '$address_zip', '$address_country', '$address_status', '$payer_email', '$payer_status', '$payment_type', '$notify_version', '$verify_sign', '$referrer_id', '$memo', '$for_auction', '$auction_buyer_id', '$auction_closing_date', '$auction_multi_item', '$payer_email', '$password', '$group_id', '$payer_email', {$v}) ")
or die(mysql_error());Then this script is supposed to remove the row ( I guess that that is "remove all rows with a date older than 3 seconds"):
Code: Select all
//Connect to MySQL
mysql_connect("localhost", "test", "test") or die(mysql_error());
//Select file system database
mysql_select_db("test") or die(mysql_error());
$v = mktime(date("H"), date("i"), date("s") - 3, date("m"), date("d"), date("Y"));
$sql = "delete from temp_users where date < {$v}";Best Regards
Oskar R