help contact form improvement

the mail() function

Moderators: macek, egami, gesf

Post Reply
developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: help contact form improvement

Post by developerahusain » Mon Jun 03, 2013 9:19 am

if ($_POST ['b_submit'])
{
$row1=mysql_fetch_array (mysql_query ("select from youraffliatetable where affliate_code='".$_POST ['aff_code']."'"));

$to =$row1 ['email'];
$subject ='Job Opportunity @ m`brace';
$message ='<head>
<title>Untitled Document</title>
<link href="../include/css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
your content
</body>
</html>
';
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

// More headers
$headers .= 'From:'.$_POST['from']."\r\n";

mail($to,$subject,$message,$headers);
echo "<script language='javascript'>window.location='?do=msg1'</script>";
}
<body>
<form name='asdf' method="post">
<input type='text' name='aff_code'>
<input type="submit" name="b_submit">
</form>
</body>

This will work out for you. Any problem do revert to me as i have done lot of coding like this

Developerahusain

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests