The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
How can i do autorespondent in PHP?-can you help me??
Discuss How can i do autorespondent in PHP?-can you help me?? in the PHP Development forum on Dev Shed. How can i do autorespondent in PHP?-can you help me?? PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 19th, 2000, 02:33 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
|
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
|

February 19th, 2000, 03:05 AM
|
|
Contributing User
|
|
Join Date: Jan 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
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
|

February 19th, 2000, 04:06 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
|
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!!!!
|

February 19th, 2000, 05:56 AM
|
|
Apprentice Deity
|
|
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237

Time spent in forums: 4 m 8 sec
Reputation Power: 17
|
|
|
If you are runnin unix or linux you can do a cron job.
|

February 20th, 2000, 10:56 AM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: Johannesburg, South Africa
Posts: 10
Time spent in forums: < 1 sec
Reputation 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?
|

February 20th, 2000, 11:53 PM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
|
How can i do cron job for executing my php file once in every day????.
can you tell me syntax????
------------------
shiju
|

February 27th, 2000, 06:22 PM
|
|
Registered User
|
|
Join Date: Aug 1999
Location: London UK
Posts: 7
Time spent in forums: < 1 sec
Reputation 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...
|

February 28th, 2000, 02:15 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
|
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
|

February 28th, 2000, 11:30 AM
|
|
Contributing User
|
|
Join Date: Feb 2000
Location: Englewood, CO
Posts: 30
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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
|

February 28th, 2000, 02:21 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: durham, nc, usa
Posts: 14
Time spent in forums: < 1 sec
Reputation 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?
|

February 29th, 2000, 04:50 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
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
|

March 7th, 2000, 06:23 AM
|
 |
.Net Developer
|
|
Join Date: Feb 2000
Location: London
Posts: 987
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 14
|
|
|
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
|

March 7th, 2000, 07:21 AM
|
|
Junior Member
|
|
Join Date: Mar 2000
Location: Toronto, Canada
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
your questions regarding cronjob or php3.cgi can be better answered by system administrator of your server machine.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|