hai all, i am working on a project, my project have 3(bronze, silver, gold) types of payments, payments are done through the paypal the expiry date is one month. if user reach the expirydate we must send email to him, after expirydate is passed his payment type change to bronze(it is free, no price to register), is it possible? if anybody having idea. please guide me.

Recommended Answers

All 11 Replies

ofc it is possible. What have you done so far?

post code. Ask a specific question. and Read the rules.

Run a cron job every day/night. Check if the date saved in the table has passed expiry date.
If yes,
send mail,
update the table with relevant changes.
If no,
do nothing.

thanks for rply, i dont know about cron job, do you have any idea or example code or any material, plz help me

Sorry, I don't have any example/material to explain. Please ask your system admin or do a search in google. That will probably show you the right direction.

save the date in a timestamp, not some human-centric text date format,
php date(); mysql now(); work

on query if($date+(30*24*60*60) < date()) { /* kill the upgrade level */} thought process only very obviously not valid code

cron:noun; approximately the server equivalent of windows task scheduler

this upgrade proces done by automatically. if user expiry his one year automatically paymenttype change to "bronse", is it possible without using cron.

comon on man for real. this is so easy. you save the day he/she purchased your service, then everyday you check if any of the users are expired, (simple SQL) and then do code.

if you show me what you have done so far I will help you more.

save the date in a timestamp, not some human-centric text date format,
php date(); mysql now(); work

on query if($date+(30*24*60*60) < date()) { /* kill the upgrade level */} thought process only very obviously not valid code

cron:noun; approximately the server equivalent of windows task scheduler

u should do this: and use time(); to put the timestamp in the databse:
now this is how i do it for my website:
u have to set the timestamp for the date it expires, not the date that it starts.(mine is twodays so i would set the time in the database to two days past the current time right when it starts:

$twodays = time() + (2 * 24 * 60 * 60);

.. its the 2 that u would have to change to a 3 or 5 f u wanted 3 or 5 days)
and then u check:

$twodays = time();
$twodaything = "activated";
$noapp = "expired";
$checkmanapp = mysql_query("UPDATE table SET status = '$noapp' WHERE status = '$twodaything' AND twodays < '$twodays'");

thanks for reply,

how it is work automatically, where do i put your code please help me.

you forget about the automatic things.
YOu simply write script to check records where current date is greater than expiry date in user table.
then for those records send mail to user and update their status from gold to bronze.

AFter you complete this script tell your administrator or webmaster to run this script every day. he/she will schedule your script to run daily.

it wont do it automatically unless u use a cron job wheich i have no idea what that is.
the only way it will work (the code i submited) is if u actually have it run on a page.
i use that code on a page that is ran when the user logs in. that way whenever someone is logged in, all the people with therestatus expired, gets there status changed to expired.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.