SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Chicago
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Auto check and email reply with PHP

    I wish to check my site automatically every day at some hour like 11 pm and then perform a check such as

    If memeber posted a message or picture then
    send email with link to all memebers
    else
    die
    end if

    I know how to send an email using php, but is there any script available that would automatically start on my server (my site is hosted by Yahoo) at a certain time and perform the above check ?

    Or do I need to make my wife turn on my computer at 11 each night and set some type of batch job on my local PC to open my web site at emailcheck.php and run the php code, etc..

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your host is a UNIX/Linux server and they allow cron jobs you can setup a job to run a php file from command line at a certain time.

    Another possiblity is if you can modify the code that allows users to add messages/photos that after it writes the data to a database or uploads the photo it sends an email to all the required people notifying them. This would be more real-time and you wouldn't have to worry about your script kicking off to run this.

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Chicago
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Good suggestion

    I thought about creating te script after each message, picture, etc. However, if there are 15 messages created in a day thats 15 messages. I need to compact things to once a day. Within one email there would be 15 links linking each message for that day.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •