html - Not redirecting after submitting the form in php -
after submitting form not able redirect successful page.
<?php ob_start(); ?> <title>feel free send thoughts</title> <?php $to ='sanaullahkhan81@gmail.com'; $name =$_post['name']; $email =$_post['email']; $message =$_post['message']; $subject ='enquiry using contact page from: '.$name ; $actul_msg ='a message contact page'. "\n".'name: '.$name."\n".' eamil: '.$email."\n" .' enquiry: '.$message; mail($to,$subject,$actul_msg); header('location: sucessfully_submitted.html'); ob_end_clean(); ?> here's a link
link success page here's a link
how manual says: http://www.php.net/manual/en/function.header.php
remember header() must called before actual output sent, either normal html tags, blank lines in file, or php.
<?php $to ='sanaullahkhan81@gmail.com'; $name =$_post['name']; $email =$_post['email']; $message =$_post['message']; $subject ='enquiry using contact page from: '.$name ; $actul_msg ='a message contact page'. "\n".'name: '.$name."\n".' eamil: '.$email."\n" .' enquiry: '.$message; mail($to,$subject,$actul_msg); header('location: http://www.yourdomain.com/sucessfully_submitted.html'); ?>
Comments
Post a Comment