PDA

Click to See Complete Forum and Search --> : [RESOLVED] HEADER problems


shuff
Jun 18th, 2008, 07:29 AM
I have the following PHP page that is the action response to another forms post:


<?php
$message = "Name: " . $_REQUEST['name'] . "\n" .
"Address: " . $_REQUEST['address'] . "\n" .
"City : " . $_REQUEST['city'] . "\n" .
"State : " . $_REQUEST['state'] . "\n" .
"Phone : " . $_REQUEST['phone'] . "\n" .
"Date: " . $_REQUEST['date'] . "\n" .
"Time: " . $_REQUEST['time'] . "\n" .
"Number of Attendees: " . $_REQUEST['people'];
mail("me@someplace.com", "Website Submission: Request A Party", $message, "From: webmaster@someplace.com");
header("Location: http://www.someplace.com/party/thankyou.html");
?>


At one time this code worked, but suddenly it gives this error:


Warning: Cannot modify header information - headers already sent by (output started at /webroot/s/o/someplace/www/party/submitparty.php:1) in /webroot/s/o/someplace/www/party/submitparty.php on line 11


The strange thing (to me at least) is that the email still gets sent.

I've read a bit on the web and made sure there is no empty line at the end of the file and even cut and paste it all into notepad and pack to see if there was any non-printable characters or something.

Can someone point me in the right direction? Thanks.

penagate
Jun 18th, 2008, 07:38 AM
Make sure you are saving using ANSI character set not Unicode.

shuff
Jun 18th, 2008, 07:49 AM
Thanks. I edited in UltraEdit and uploaded it via FTP and everything works now!!!

I had been editing it in Expression Web live on the website via FrontPage Extensions (I know everyone hates that, but I like the ablity to edit live) - but I see that causes problems now on LINUX boxes.

Thanks for the help.

penagate
Jun 18th, 2008, 07:53 AM
I like the ability to edit live too. Any remote file I open via WinSCP is monitored for local changes and automatically uploaded to the server when I save in whatever editor I'm using, with no need for any extra server-side applications.

Unicode blows PHP up, regardless of OS, because it doesn't know how to handle the byte-order mark at the start of the file.

manavo11
Jun 26th, 2008, 07:23 PM
I like the ability to edit live too. Any remote file I open via WinSCP is monitored for local changes and automatically uploaded to the server when I save in whatever editor I'm using, with no need for any extra server-side applications.

Unicode blows PHP up, regardless of OS, because it doesn't know how to handle the byte-order mark at the start of the file.
I remember having this problem, but in dreamweaver I was able to find a setting to remove the BOM from the files.

visualAd
Jul 4th, 2008, 04:21 AM
I remember having this problem, but in dreamweaver I was able to find a setting to remove the BOM from the files.
I use GVIM to edit my PHP files. :)