#1
  1. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    i want to do an autorespondent in PHP3.0.
    i have a datebase called "birthdates".

    In that people can enter their date of births.An email should generate automatically reminding the user about his birthday.That might be before 1-2 weeks before his birthday.

    How can i do it???,Do you have any idea???.







    ------------------
    shiju
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    79
    Rep Power
    15
    Hi, I'm not sure if this would work....but no-one else has answered you so i'll give it a go

    Have a page which you go to once a day or find a way u can auto load it once a day which is like this...

    <?
    $date = date ("d-m-Y"); //look up date() function at php.net for formating procedures

    mysql_connect('localhost','login','password' );
    $query = "select * from table where birthdate='$date'";
    $result=mysql_db_query("database",$query);
    while ($row=mysql_fetch_object($result))

    $message = "hey $row->name, its your birthday, come to www.dmusic.com.au and you will receive a present heh";

    mail("$row->email","Happy Birthday $row->name !","$message");

    mysql_free_result($result);
    ?>

    If you have any questions just leave them here.


    Good luck
    Basil
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Thank you tantrum,

    I know how to do the database program for that...

    But...

    i would like to know one thing,

    Is thier any other way to run this program daily with out our intraction???.

    If it has any other option please tell me!!!

    Thanks alot!!!!





  6. #4
  7. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    If you are runnin unix or linux you can do a cron job.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Johannesburg, South Africa
    Posts
    10
    Rep Power
    0
    do you meen one can set a cron job to run the .php3 page - or must one use mysql commands - how would one for example make the above page run automatically with CRON?

  10. #6
  11. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    How can i do cron job for executing my php file once in every day????.

    can you tell me syntax????

    ------------------
    shiju
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 1999
    Location
    London UK
    Posts
    7
    Rep Power
    0
    this is an example of a cron job you could use if you only have mod_php:

    59 23 * * * lynx -dump http://www.server.com/script.php3>>/var/log/messages

    basically use lynx to simulate visiting a page. you might want to worry about security here: perhaps the script referred to should only be accessible to localhost.

    in httpd.conf you could use:
    #
    <Directory /secret/scripts>
    Order allow,deny
    Allow from localhost
    </Directory>
    #

    if you have access to cgi php you could simply write the php script, placing

    #!/pathto/php

    at the top. then the cron would be:

    59 23 * * * /path/to/your/script

    hope this helps...
  14. #8
  15. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi kourou,

    I am not able to reach that URL which you given in your answer.

    i am not able to understand the script which you given in your answer as well.


    can you explain it clearly????.

    Is it possible to write a shell program for the same action???

    Thank you


  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Englewood, CO
    Posts
    30
    Rep Power
    15
    You could create a Perl script to retrieve the data from the database and use sendmail (or other email app) to send to the address. You'll use the Perl DBI module with the MySQL driver (DBD). The documentation for DBI shows how to connect, execute a query and retrieve records.

    -TM
  18. #10
  19. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    durham, nc, usa
    Posts
    14
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Shiju Rajan:

    i want to do an autorespondent in PHP3.0.
    i have a datebase called "birthdates".

    In that people can enter their date of births.An email should generate automatically reminding the user about his birthday.That might be before 1-2 weeks before his birthday.

    How can i do it???,Do you have any idea???.

    [/quote]

    I believe your question was answered quite well. I am very interested in this project, however. Is this sponsored by MicroSoft, or is there a Government grant to develop an application that helps folks remember their birthdays?


  20. #11
  21. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi jodonnell,

    Thank you for your interest in my question.

    Actually i am doing this project for one of my client(freelance).

    you may see the site at: http://www.reminder2u.com


    Thanks alot



    ------------------
    shiju
  22. #12
  23. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hello kourou,

    i have not solved my problem yet.I have finshed the programming part but now i want to execute cron job for sending reminders.

    <<<if you have access to cgi php you could simply write the php script, placing

    #!/pathto/php

    at the top. then the cron would be:

    59 23 * * * /path/to/your/script

    hope this helps...
    >>>

    can you tell me one thing ,

    how can i find out whether i have the access to cgi php ?,

    Is it possible to execute the cron job through telnet??..

    Pls give me an answer.

    Thank you


  24. #13
  25. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Toronto, Canada
    Posts
    13
    Rep Power
    0
    your questions regarding cronjob or php3.cgi can be better answered by system administrator of your server machine.

Similar Threads

  1. Replies: 2
    Last Post: August 18th, 2004, 11:45 PM
  2. How to see the Memory used by a PHP script?
    By Pardall in forum PHP Development
    Replies: 4
    Last Post: February 13th, 2004, 04:54 PM
  3. PHP with UnixODBC
    By coder4hire in forum PHP Development
    Replies: 2
    Last Post: January 20th, 2004, 02:14 PM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 04:12 PM
  5. UnixODBC + PHP + Apache + Empress
    By coder4hire in forum Database Management
    Replies: 0
    Last Post: January 15th, 2004, 02:41 PM

IMN logo majestic logo threadwatch logo seochat tools logo