Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Script? - Sending Every Birthday an personalized Email

General discussions related to php

Moderators: macek, egami, gesf

basis for you

Postby Oleg Butuzov » Wed Apr 02, 2003 4:28 am

$date=date();

$query=mysql_query("select `name` from `people` where `birthday` = '$date'");

loop {
mail for every person
}
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

A suggestion

Postby dhirendrak » Sat Apr 05, 2003 4:37 am

Previous post not solve your problem.

Here is a suggestion.
I assume that you want to send birthday message to all member whose birthdate stored in database in time stamp format this time stamp format must be php $date=time(); during registration or posting of birth date.
This script will help you to send the birthday message to all member has the birthday.

$from=mktime(0,0,0,date('m',time()),date('d',time()),date('y',time()));
$to=mktime(23,59,59,date('m',time()),date('d',time()),date('y',time()));

$query=mysql_query("select name from people where birthday > $from and birthday <= $to");

loop {
mail for every person
}


You can run this script through cron jobs so that it will automaticaly execute on a particular time. you can change this code according to you convenience
dhirendrak
New php-forum User
New php-forum User
 
Posts: 7
Joined: Fri Apr 04, 2003 5:10 am
Location: india


Return to PHP General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.