CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 sample needed

Print topic Send  topic

Author Message
crush899

Posts: 22
Posted: 06/29/2011, 12:53 AM

Need code or sample for how to generate an email (reminder/notification) message when a user defined date is reached.
View profile  Send private message
beevet

Posts: 47
Posted: 06/29/2011, 2:39 AM

Will someone be accessing the web site on this date? If so, you could have a page where the current date is compared to the date stored in the database and send an email if the stored date is the same as the current date. You would need to make sure that page is accessed each day for the script to run.


In the other situation, no one is for sure visiting the site, but you still want a reminder sent. I think that needs to be done with a program scheduled to run automatically on your server, not necessarily through a PHP page. I have wondered about this second scenario and would appreciate any thoughts on how to get this done also. Is this a CRON job type of thing? Does that automatically scheduled program just call the PHP page so it can execute the script?

Chris
View profile  Send private message
jjrjr2


Posts: 131
Posted: 06/29/2011, 9:45 PM

You can create a php script in codecharge that will do your mail stuff.

Once you have created that and tested it.. Just remove all the page output in the Before Output event like so..

global $main_block;
$main_block ="";

This will prevent the page from generating any output when run as a CRON task.

Now all you gotta do make a crontab entry for it.

Your CRON statement would be calling the script something like

/pathtophp/php /pathtoyourscript/yourscript.php

Verify you do not need any switches for the php command and then all should be golden..

Have fun
John8-)

_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
Real Web Development At: http://RealWebDevelopment.us
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.