| | |
Help with query
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jan 2008
Posts: 100
Reputation:
Solved Threads: 1
That worked great. I did have to put this in:
and make my mail line look like this:
It seems that using the $message twice confised things, so changing the first one to $mmessage fixed that problem.
My next plan is to get the server to run this at a preestablished time using task manager. Do you see a problem with this, or is there a better way. I only want it to run once per day.
Thanks for all your help, its great.
PHP Syntax (Toggle Plain Text)
$mmessage = "Today's Calendar Events Reminder: \n" . $message;
PHP Syntax (Toggle Plain Text)
mail($to,$subject,$mmessage,$headers);
My next plan is to get the server to run this at a preestablished time using task manager. Do you see a problem with this, or is there a better way. I only want it to run once per day.
Thanks for all your help, its great.
•
•
Join Date: Jan 2008
Posts: 100
Reputation:
Solved Threads: 1
I'm running on a windows server with IIS. I did try to run it using task manager on my test machine (windows XP w/IIS), telling it to run a php file only opened the file for editing at the designated time. This is my first time doing this, how would I get this to run at a designated time using task manager?
•
•
Join Date: Jan 2008
Posts: 100
Reputation:
Solved Threads: 1
Ok, I did some research and got this to work. For people who don't know how to set up a cronjob in Windows/IIS, here is how I did it.
First I created a .bat file called cron.bat, created it in notepad and saved it as that file name, here is the code:
timemail.php is the file I wanted to run. C:\PHP is the location of my php.exe file that will run it. The only way I could get it to work was by putting it in my web root. I don't know if this is a security problem or not, but i'm running this on my network intranet server so I can get away with it. I then set up a schedule to run the cron.bat file at a specified time. my timemail.php file pulls data from my calendar and sends an email to designated people stating what events are occurring for that day, i let it run at like 4am before everyone gets to work. Thats it. I thought this was going to be real hard, but it was quite easy. Fearing the unknown is no fun.
Thanks for ya'lls help with getting this running, I really appreaciate it.
First I created a .bat file called cron.bat, created it in notepad and saved it as that file name, here is the code:
PHP Syntax (Toggle Plain Text)
SET PATH="c:\PHP" start php.exe timemail.php
timemail.php is the file I wanted to run. C:\PHP is the location of my php.exe file that will run it. The only way I could get it to work was by putting it in my web root. I don't know if this is a security problem or not, but i'm running this on my network intranet server so I can get away with it. I then set up a schedule to run the cron.bat file at a specified time. my timemail.php file pulls data from my calendar and sends an email to designated people stating what events are occurring for that day, i let it run at like 4am before everyone gets to work. Thats it. I thought this was going to be real hard, but it was quite easy. Fearing the unknown is no fun.
Thanks for ya'lls help with getting this running, I really appreaciate it.
![]() |
Similar Threads
- Sql Query (VB.NET)
- Removing Query Strings (ASP.NET)
- Double MySQL Query (PHP)
- Dynamic Query (JSP)
- MySQL nested query / joined query conversion help (MySQL)
- problem with lengthy query (Java)
- Retreiving variables from a sql query into a form (PHP)
- Query Building (Database Design)
Other Threads in the PHP Forum
- Previous Thread: Concurrent Query ?
- Next Thread: Arrays: Invertated Commas and Apostrophes
| Thread Tools | Search this Thread |
301 apache api array autosuggest beginner binary broken cakephp checkbox class cms code compression cron curl data database date display dropdownlist dynamic echo email eregi error execution file files folder foreach form forms function functions google href htaccess html httppost if...loop image include insert ip javascript joomla jquery key library limit link links login mail md5 menu mlm multiple mysql mysql_real_escape_string oop paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote script search searchbox server session sessions sms sorting source space sql syntax system table tutorial update upload url validator variable video volume votedown web website youtube zend





