PHP script problem...
Posted: Tue Jun 02, 2009 3:42 am
Hi to all,
I know I am going to ask a silly question. But there is no way out. I have developed a HTML website. Now It has a "contact us" form. Now the client want that the details which the user will enter in the form should go to his email address.
I searched a lot and got the answer it is done by using php script. Then I made a php script. But I am unable to send the email. I am doing like this:
PHP Script:
In the Html form I am using these lines:
Please assist me where I am lacking. Waiting for your response.
cheers
sneha
I know I am going to ask a silly question. But there is no way out. I have developed a HTML website. Now It has a "contact us" form. Now the client want that the details which the user will enter in the form should go to his email address.
I searched a lot and got the answer it is done by using php script. Then I made a php script. But I am unable to send the email. I am doing like this:
PHP Script:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
<body>
<?php
$firstname = $_POST['firstname'] ;
$lastname = $_POST['lastname'] ;
$company = $_POST['company'] ;
$phoneno = $_POST['phoneno'] ;
$mobileno = $_POST['mobileno'] ;
$email = $_POST['email'] ;
$city = $_POST['city'] ;
$country = $_POST['country'] ;
$message = $_POST['message'] ;
$email_to = "rohanrajpoot@hotmail.com";
$email_subject = "contact details of the User";
$format = <<<EOF
<html>
<body bgcolor="#F0EFE3">
<h3>Message from your website:</h3> <br />
First Name: $firstname<br />
Last Name: $email<br/>
Company: $company<br/>
Phone No:$phoneno<br/>
Mobile No:$mobileno<br/>
E-Mail:$email<br/>
City:$city<br/>
Country:$country<br/>
Message:$message<br/>
</body>
</html>
EOF;
mail( $email_to, $email_subject,$format,$email );
?>
</body>
</html>
Code: Select all
<form id="form1" name="form1" action="sendmail.php" method="post" enctype="text/plain" >
cheers
sneha