Results 1 to 6 of 6

Thread: [RESOLVED] HEADER problems

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    5

    Resolved [RESOLVED] HEADER problems

    I have the following PHP page that is the action response to another forms post:

    Code:
    <?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("[email protected]", "Website Submission: Request A Party", $message, "From: [email protected]");
    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.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: HEADER problems

    Make sure you are saving using ANSI character set not Unicode.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2008
    Posts
    5

    Re: HEADER problems

    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.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] HEADER problems

    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.

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: [RESOLVED] HEADER problems

    Quote Originally Posted by penagate
    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.


    Has someone helped you? Then you can Rate their helpful post.

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [RESOLVED] HEADER problems

    Quote Originally Posted by manavo11
    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.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width