943,704 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 802
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
May 20th, 2009
0

Re: Help with query

That worked great. I did have to put this in:
PHP Syntax (Toggle Plain Text)
  1. $mmessage = "Today's Calendar Events Reminder: \n" . $message;
and make my mail line look like this:
PHP Syntax (Toggle Plain Text)
  1. mail($to,$subject,$mmessage,$headers);
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.
Reputation Points: 10
Solved Threads: 1
Junior Poster
rickarro is offline Offline
107 posts
since Jan 2008
May 20th, 2009
0

Re: Help with query

If you want to run in once a day, then that would be fine, if you are on a Linux server, a Cron job would be best.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
May 21st, 2009
0

Re: Help with query

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?
Reputation Points: 10
Solved Threads: 1
Junior Poster
rickarro is offline Offline
107 posts
since Jan 2008
May 21st, 2009
0

Re: Help with query

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:
PHP Syntax (Toggle Plain Text)
  1. SET PATH="c:\PHP"
  2. 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.
Reputation Points: 10
Solved Threads: 1
Junior Poster
rickarro is offline Offline
107 posts
since Jan 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Concurrent Query ?
Next Thread in PHP Forum Timeline: Arrays: Invertated Commas and Apostrophes





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC