Jump to content

My Redirect not working after form submission


cosmoasif

Recommended Posts

Hi

 

I have a from, now after the users send the form, i want to redirect to a thank you page. my code does not redirect and gives me this error

 

Warning: Cannot modify header information - headers already sent by (output started at D:\inetpub\vhosts\feelmalaysia.com\httpdocs\sendmailsqlar.php:1) in D:\inetpub\vhosts\feelmalaysia.com\httpdocs\sendmailsqlar.php on line 25

 

I have the redirect page saved in the same directory as the php file.

my Php Code :

 

<?php

$headers .= 'Content-type: text/plain; charset=UTF-8; format=flowed' . "\r\n";

$headers .= 'Content-Transfer-Encoding: 8bit'."\r\n";                   

$to = "xxx@xxx.com";

$visitor = $_REQUEST['Name'] ;

$visitormail = $_REQUEST['Email'] ;

$nationality = $_REQUEST['Nationality'] ;

$stulevel = $_REQUEST['Level'] ;

$stfield = $_REQUEST['Field'] ;

$message = $_REQUEST['Message'] ;

$header = "From: $visitormail\n"

  . "Reply-To: $visitormail\n";

$subject = "Arab Enquiry";

$message = "From: $visitor \n\n Email: $visitormail \n\n Nationality: $nationality \n\n Level: $stulevel \n\n Field: $stfield \n\n Message: $message";

mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header, $headers);

 

//Sending auto respond Email to visitor

$reply_header = "From: xxx@xxx.com\n"

  . "Reply-To: xxx@xxx.com\n";

$reply_subject = "- تم استلام طلبكم";

$reply_to = "$visitormail";

$reply_message = "$visitor \n\n شكرا لزيارتكم موقعنا . \n نود ابلاغكم بأنه تم استلام طلبكم وسوف يتم الرد عليكم قريبا.\n هذه الرسالة مرسلة من نظام الموقع.\n شكرا\n ";

mail($reply_to, '=?UTF-8?B?'.base64_encode($reply_subject).'?=', $reply_message, $reply_header, $headers);

 

header('Location: thankyouar.html');

 

?>

 

 

 

Please help . Thank you

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.