...

View Full Version : selecting mail-id after link click in php



mrjameer
11-09-2006, 04:40 PM
hi,

i have a mysql table which contains client details.
fields are as follows

1.name 2.mailid 3.sendmail 4.status
1.abc 2.abc@yahoo.com 3.send 4.not updated
1.xyz 2.xyz@hotmail.com 3.send 4.not updated

here 'send' is the link and when i click on it, it opens a email form to send mail to abc@yahoo.com or xyz@hotmail.com.i want to know how i can select the mailid from db when i click on 'send' link and print it on email form and i should send mail to that mail id.after sending mail to a person here 'status' should be updated. your help will be appreciated


thanks

mrjameer

rafiki
11-09-2006, 07:03 PM
if you create a drop down or radio buttons for who to send the mail to should be easier or even a text area


<?php
include(connection.php);

$result = mysql_query("SELECT $mail FROM `mailid` WHERE `user` = `$user`);
if (!$result)
{
echo "error running query";
}
else
{
mail($result, 'your subject line', 'yourbody', 'yourheaders');
}
if(mail($result, 'your subject line', 'yourbody', 'yourheaders'))
{
header( Location : "http://server.com/sentmail.php?to=$result");
}
else
{
echo "error sending mail";
}

mysql_close($db);

?>
thats not it exactly but does it give u an idea?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum