Beginner !! Cannotmodifyheaderinformation... I want to use PHPcontactform to create an inquirypage, so that you can enter your name, phone number, email, etc, press "send" to send the above information to my mailbox, but I am a newbie... The entire co is a beginner !! Cannot modify header information... Problem TAT
I want to use PHP contact form to create an inquiry page, so that people can fill in the name, phone number, email, etc. press "send" and the above information will be sent to my mail box by email.
But I'm a newbie... The entire contact form is basically used to copy and modify the network to teach: http://myphpform.com/php-form-tutorial.php
After "send" is pressed, I want to jump to the thank you page, but "Cannot modify header information-header already sent by (output started at C: \ inetpub \ wwwroot \ contant2.php: 1) in C: \ inetpub \ wwwroot \ contant2.php on line 34"
* Line34 = header ('Location: ThankYou.html ');
I found a solution and tried it.
1. Add exit () after the header ();
2. add And ob_end_flush ();
Finally, an email can be sent successfully. Any omission in the information will jump to the error page, but it is impossible to go to the thank you page... Cannot modify header information (omitted)
Is there an error in the place where I add exit/ob_start? Is there any other problem?
Please take a look> <"
The following code is used:
P.S. I used notepad for this php file.
PHP code
Order form error
Please correct the following error:
------ Solution --------------------
Discussion
Oh... sorry, that blank line is the one that slides and presses when posting...
------ Solution --------------------
Check whether the file has a bom header. If yes, remove it.
Add ob_clean () to header ('Location: ThankYou.html ');.
------ Solution --------------------
In addition to On, you also need to set the display level.
Error_reporting (E_ALL );
Discussion
I changed the header line
// Header ('Location: ThankYou.html ');
Then, display_errors = On is changed in php. ini.
Is that correct?
(I am not using apache but IIS) after restarting... the browser shows a blank space ......