Jump to content

My Redirect not working after form submission


Recommended Posts



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 :



$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

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 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.