Parse Error in unexpected T_Variable. Subscription Mail Form - php

So I have this form.
Its a very simple mail/newsletter form.
<form action="http://localhost/website/subscribe.php" method="POST" id="signup_form">
<label for="email"><p id = "subText">Subscribe</p></label>
<input type="text" name="email" size="30" class="required email txtEmail" placeholder = "Enter Email Address">
<input type="submit" value="Go" name="submit" class = "goButton"/>
</form>
and I have this subscribe.php file.
<?php
if(isset($_POST['email']))
{
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "email#email.com";
$email_subject = "Subscription";
function died($error)
{
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if( !isset($_POST['email']))
{
died('We are sorry, but there appears to be a problem with the form you submitted.');      
}
$email_from = $_POST['email']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from))
{
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0)
{
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string)
{
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Email: ".clean_string($email_from)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers); 
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
That I found here, I just edited it a bit to fit my form. I'm really new to PHP and I'm still in the practice phase.
The error I get is
PHP Parse error: syntax error, unexpected T_VARIABLE in /home/techstars05/www/website/subscribe.php on line 6, referer: http://localhost/website/index.html
I'm using sublime text 2 to edit the codes and I noticed that "if(isset($_POST['email']))"'s 'if' is of a different color from the other ifs from the subscribe.php file. Its pink while the others are violet-ish. I'm not really sure what does mean, I tried tracing the code but to my newbie eyes it looks quite fine.
TIA

give this a try :
<?php
if(isset($_POST['email'])) {
//email is set
$email_from = $_POST['email'];
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(preg_match($email_exp,$email_from)) {
//email data
$email_from = $_POST['email'];
$email_to = "email#email.com";
$email_subject = "Subscription";
//create body
$email_message = "Form details below.\n\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
$headers .= 'Reply-To: '.$email_from."\r\n" .
$headers .= 'X-Mailer: PHP/' . phpversion();
if(mail($email_to, $email_subject, $email_message, $headers)){
echo "email sent successfully";
exit();
}else{
echo "email failed to send";
}
}else{
echo "email is not valid";
}
}else{
echo "email is not set";
}
function clean_string($string){
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
?>

Related

Sent mail using HTML [duplicate]

This question already has answers here:
How can I send an email using PHP?
(20 answers)
Can't send email with php mail function on windows 8
(8 answers)
Closed 5 years ago.
I am building a simple html website and i have to send the email from contact us form. I dont have any idea how to send mail using html. I am trying to send the mail using php in such a way succees message is shown but the mail is not receiving neither in inbox nor in spam. Is there any alternate to escape from php or is there any free api to send the mail.
here is php code .
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "you#yourdomain.com";
$email_subject = "Your email subject line";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
If I understand your issue correctly, you have a contact form on a page, which when it's filled in and submitted, should send an email to your inbox for you to deal with. If that's the case, I would truly recommend looking into https://formspree.io/. The way Formspree works, is instead of you handling the POST response, you send it straight to Formspree. They take the response, process it for you, and email you the contents straight away.
You will not have to worry about running a server or anything like that, and you'll be guaranteed to receive the emails all the time. Plus it's free for up to 1000 emails a month.
Try this code! I have tested and working!
create new file contact.php and add this to the file!
You can customize HTML/CSS later!
<?php
if(isset($_POST['submit'])){
$to = "email#example.com"; // this is your Email address
$from = $_POST['email']; // this is the sender's Email address
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message = $first_name . " " . $last_name . " wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
mail($to,$subject,$message,$headers);
mail($from,$subject2,$message2,$headers2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
}
?>
<!DOCTYPE html>
<head>
<title>Form submission</title>
</head>
<body>
<form action="" method="post">
First Name: <input type="text" name="first_name"><br>
Last Name: <input type="text" name="last_name"><br>
Email: <input type="text" name="email"><br>
Message:<br><textarea rows="5" name="message" cols="30"></textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

PHP Mail form doesn't work when certain text is entered

I'm working on a PHP mail form and for some reason only certain text doesn't send through. It has me baffled and I can't even think of how to Google an answer.
For example, if I enter for the form:
Name: Indiana Jones
Number: 000
Email: indiana#jones.com
The mail function won't work, however if I change the 000 to 999, it works.
OR if I change the indiana#jones.com to indiana#jones.net, it suddenly works too.
Here are snippers, from my HTML:
<form method="post" action="mail.php">
Name<br />
<input style="width:878px;" type="text" name="name" id="name" required>
Best Contact Number<br />
<input style="width:415px;" type="text" name="number" id="number" required>
Email<br />
<input style="width:415px;" type="email" name="email" id="email" required>
</form>
And from my PHP (mail.php): (personal email addresses have been removed)
<?php
ini_set("SMTP","mail.email.com.au");
ini_set('sendmail_from', 'email#email.com.au');
$to = "email#email.com.au";
$subject = "Mail Form";
$message = "Name:" . "\n" . $_POST['name'] . "\n\n";
$message .= "Best Contact Number:" . "\n" . $_POST['number'] . "\n\n";
$message .= "Email:" . "\n" . $_POST['email'] . "\n\n";
$headers = "From: Removed <email#email.com.au> \n";
if(#mail($to, $subject, $message, $headers))
{
echo "<script type='text/javascript'>alert('Thank you for your submission'); window.location.href = 'index.html';</script>";}
else
{
echo "<script type='text/javascript'>alert('There was an error - please check all fields and try again'); window.location.href = 'index.html';</script>";
}
?>
well, I just got a code that will make it work great .
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "email#email.com.au";
$email_subject = "Mail Form";
function died($error) {
// your error code can go here
echo "<script type='text/javascript'>alert('There was an error because '); window.location.href = 'index.html';</script>";
die();
}
// validation expected data exists
if(!isset($_POST['name']) ||
!isset($_POST['number']) ||
!isset($_POST['email'])) {
died('<script type='text/javascript'>alert('There was an error - please check all fields and try again'); window.location.href = 'index.html';</script>');
}
$name = $_POST['name']; // required
$email = $_POST['email']; // required
$number = $_POST['number']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 0) {
$error_message .= 'The Number you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email)."\n";
$email_message .= "Number: ".clean_string($number)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- if sent successfuly -->
<script type='text/javascript'>alert('Thank you for your submission'); window.location.href = 'index.html';</script>
<?php
}
?>
You can add this code to display the errors for users
echo $error."<br /><br />";
Sorry, it turns out this was an Exchange server issue. I have no idea why it was letting some messages go through and filtering others, but our IT team sorted it out and had to allow the website's IP through.
Form is fully functional now though!

custom plugin not sending email

I am trying to develop a simple contact form but the form is not sending any email and I do not know how to debug and how to solve this issue.
this is my plugin code:
<?php
/*
Plugin Name: Contact Form
Plugin URI: http://www.exmple.com/
Description: This plugin allows captcha for a contact form.
Version: 1.0
Author URI: http://www.example.com/
License: GPL2
*/
?>
<?php
function contact_shortcode_func( $atts, $content="" ) {
$content.="<div id='contact_form_errorloc' class='err'>".plugins_url()."</div>
<form method='POST' name='contact_form'
action='".str_replace( '%7E', '~', $_SERVER['REQUEST_URI'])."'>
<p>
<label for='name'>Name: </label><br>
<input type='text' name='name1' value=''>
</p>
<p>
<label for='email'>Email: </label><br>
<input type='text' name='email1' value=''>
</p>
<p>
<label for='message'>Message:</label> <br>
<textarea name='message1' rows='8' cols='30'></textarea>
</p>
<input type='submit' value='Submit' name='submit'>
</form>";
return $content;
//echo $your_email ='xxxxx#gmail.com';// <<=== update to your email address
if(isset($_POST['submit']))
{
$your_email ='xxxxx#gmail.com'; //here i am using valid email id
$name = $_POST['name1'];
$visitor_email = $_POST['email1'];
$user_message = $_POST['message1'];
///------------Do Validations-------------
//send the email
$to = $your_email;
$subject="New form submission";
$from = $your_email;
$ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
$body = "A user $name submitted the contact form:\n".
"Name: $name\n".
"Email: $visitor_email \n".
"Message: \n ".
"$user_message\n".
"IP: $ip\n";
$headers = "From: $from \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
wp_mail($to, $subject, $body,$headers);
//header('Location: thank-you.html');
}
}
add_shortcode( 'cfwc', 'contact_shortcode_func' );
So any idea how to fix it.
Your mail functionality is written behind return of your function. This is code that is never reached.
Everything after return $content; will not be executed. Move your return to the end of your function.
Here is the complete working form you can take the help from this code, this can be include into html form as post.
<?php
if(isset($_POST['email'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "user#gmail.com";
$email_subject = "Your email subject line";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['phone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['phone']; // not required
$comments = $_POST['comments']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
<h4 align="center">Thank you for contacting us. We will revert you back.</h4>
<?php
}
?>

Sending a form to email not working

I am trying to make a form that will be sent to my email. But it display errors on submission. Javascript to validate the form is not shown but it works fine.
I am not sure what's wrong with my code below, been trying to figure out all day and reading various threads but to no avail.
Below is my php code to handle the form.
<?php
if(isset($_POST['name'])) {
// EDIT THE 2 LINES BELOW AS REQUIRED
$email_to = "me#gmail.com";
$email_subject = "Nexwave Form";
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
$name = $_POST['name']; // required
$designation = $_POST['designation'];
$company = $_POST['company'];
$contact = $_POST['contact'];
$email = $_POST['email']; // not required
$users = $_POST['users']; // required
$error_message = "";
$string_exp = "/^[A-Za-z .'-]+$/";
$email_message = "Form details below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Designation: ".clean_string($designation)."\n";
$email_message .= "company: ".clean_string($company)."\n";
$email_message .= "Contact ".clean_string($contact)."\n";
$email_message .= "email: ".clean_string($email)."\n";
$email_message .= "Number of Users: ".clean_string($users)."\n";
// create email headers
$headers = 'From: '.$email."\r\n".
'Reply-To: '.$email."\r\n" .
'X-Mailer: PHP/' . phpversion();
echo (int) mail($email_to, $email_subject, $email_message, $headers);
?>
<!-- include your own success html here -->
Thank you for contacting us. We will be in touch with you very soon.
<?php
}
?>
Below is my html code:
<form name="form" action="send_mail.php" onSubmit="return validateForm();" method="POST">
Name<br/><input name="name" type="text" style="width:90%;"/><br/>
Designation<br/><input name="designation" type="text" style="width:90%;"/><br/>
Company<br/><input name="company" type="text" style="width:90%;"/><br/>
Contact Number<br/><input name="contact" type="text" style="width:90%;"/><br/>
Email<br/><input name="email" type="text" style="width:90%;"/><br/>
Number of Users<br/><input name="users" type="text" style="width:90%;"/>
<span style="text-align:right;display:block;width:174px;"><input style="height:25px;margin-top:20px;margin-bottom:10px;background-color:#ffffff;border:0;color:#009110;" type="submit" class="submit" value="Submit" /></span>
</form>
below is the error:
This is what i get even after changing the email_address and email_from.
"; echo $error."
"; echo "Please go back and fix these errors.
"; die(); } $name = $_POST['name']; // required $designation = $_POST['designation']; $company = $_POST['company']; $contact = $_POST['contact']; $email = $_POST['email']; // not required $users = $_POST['users']; // required $error_message = ""; $string_exp = "/^[A-Za-z .'-]+$/"; $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "Name: ".clean_string($name)."\n"; $email_message .= "Designation: ".clean_string($designation)."\n"; $email_message .= "company: ".clean_string($company)."\n"; $email_message .= "Contact ".clean_string($contact)."\n"; $email_message .= "email: ".clean_string($email)."\n"; $email_message .= "Number of Users: ".clean_string($users)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email."\r\n" . 'X-Mailer: PHP/' . phpversion(); echo (int) mail($email_to, $email_subject, $email_message, $headers); ?> Thank you for contacting us. We will be in touch with you very soon.
your help is very much appreciated
You have many errors present in this script as mentioned by question comments above.
email form name email_address is not the same as $_POST['email']
you are not defining $email_from before you call it.
I would do some simple testing before posting a question like this and try to echo out all the variables one by one and see what you get. This would show you the two mentioned errors. And if you cannot solve it and still have errors then please post your error message so others can be of more assistance than just it doesn't work.

HTML file calls PHP which runs fine but tags the PHP file name on the HTML I want to open

I am new to PHP,
The follow HTML calls send_form_email.php
<form name="contactform" method="post" action="send_form_email.php">
<p align="center"><font face="Arial" color="#4F4F4F"><strong>Subscribe to our
News letter: </strong></font><input type="text" value="enter your email address" onfocus="blank(this)" onblur="unblank(this)" name="email" size="20">
<input type="submit" value="Submit">
the follow PHP code runs correctly:
<?php
if(isset($_POST['email'])) {
$email_to = "subscribe#myithost.net";
$email_subject = "News Letter Opt In";
function died($error) {
echo "We are very sorry, but the email adress submitted does not appear to be valid";
echo "The error appears below<br /><br />";
echo 'Please go back and fix the error<br /><br />';
die();
}
// validation expected data exists
if(!isset($_POST['email'])) {
died('We are sorry, but there appears to be a problem with the email you submitted.');
}
$email_from = $_POST['email']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "News Letter Opt in Member, see below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Email: ".clean_string($email_from)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n".
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers);
?>
<?php include 'index.html'; ?>
<?php
}
?>
But the problem i have is that it returns me to http://www.myithost.net/send_form_email.php not www.myithost.net/index.html
Any help would be much appreciated
You need to redirect the user. Put something likethis at the end of your php file
header("Location: http://mydomain.com/index.html");
Try this for the PHP:
<?php
if(isset($_POST['email'])) {
$email_to = "subscribe#myithost.net";
$email_subject = "News Letter Opt In";
function died($error) {
echo "We are very sorry, but the email adress submitted does not appear to be valid";
echo "The error appears below<br /><br />";
echo 'Please go back and fix the error<br /><br />';
die();
}
// validation expected data exists
if(!isset($_POST['email'])) {
died('We are sorry, but there appears to be a problem with the email you submitted.');
}
$email_from = $_POST['email']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+#[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "News Letter Opt in Member, see below.\n\n";
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
$email_message .= "Email: ".clean_string($email_from)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n".
'X-Mailer: PHP/' . phpversion();
#mail($email_to, $email_subject, $email_message, $headers);
header("Location: http://www.example.com/index.html"); // <--- ADD ME
exit(); // <--- ADD ME
}
?>
Replace :
#mail($email_to, $email_subject, $email_message, $headers);
?>
<?php include 'index.html'; ?>
<?php
}
?>
By :
#mail($email_to, $email_subject, $email_message, $headers);
header("Location: http://mydomain.com/index.html");
}
?>
N.B : Make sure no chars are displayed BEFORE header() function call.

Categories