Help with query

Thread Solved

Join Date: Jan 2008
Posts: 100
Reputation: rickarro is an unknown quantity at this point 
Solved Threads: 1
rickarro rickarro is offline Offline
Junior Poster

Re: Help with query

 
0
  #11
May 20th, 2009
That worked great. I did have to put this in:
  1. $mmessage = "Today's Calendar Events Reminder: \n" . $message;
and make my mail line look like this:
  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.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 524
Reputation: Will Gresham is on a distinguished road 
Solved Threads: 86
Sponsor
Will Gresham's Avatar
Will Gresham Will Gresham is offline Offline
Posting Pro

Re: Help with query

 
0
  #12
May 20th, 2009
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.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 100
Reputation: rickarro is an unknown quantity at this point 
Solved Threads: 1
rickarro rickarro is offline Offline
Junior Poster

Re: Help with query

 
0
  #13
May 21st, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 100
Reputation: rickarro is an unknown quantity at this point 
Solved Threads: 1
rickarro rickarro is offline Offline
Junior Poster

Re: Help with query

 
0
  #14
May 21st, 2009
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:
  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.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC