Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default Irritating Problem

    Im having this really irritating problem where , im trying to redirect to a page but im getting the error

    'Warning: Cannot modify header information - headers already sent by (output started at /home/blah/blah/blah/) in /home/blah/blah/blah/ on line 23
    '

    I have login.php which contains all the PHP (When the user logs in it creates a session and tries to redirect to interface.php which contains functions.) and login_main.php which has the HTML and some other bits and bobs. The form in the html uses
    Code:
    <form action="login.php" method="post">
    I cant seem to find a way around it. Whenever i try to use header( 'ocation: page.php'); i get that error.

    Its probably a silly mistake but. Advice?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    You can't output any HTML (Or anything really) to the browser before you send headers.

  3. #3
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Just put the login info (from the login_main.php) into the login.php file at the bottom and send the form through a GET parameter or whatever (EG: login.php?login=true). Then at the very top of the document so then there is no outputted data before the headers, have the login php code.
    Last edited by Invent; 29-03-2007 at 04:05 PM.

  4. #4
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    This is what I realy hate about PHP & HTML

  5. #5
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    What's so hard about doing that?

  6. #6
    Join Date
    Jul 2005
    Location
    Bristol
    Posts
    2,054
    Tokens
    -10

    Latest Awards:

    Default

    Hmm well i pretty much rewrote it. According to the error. Its because of the connect.php .. But i cant see why it would be.

Posting Permissions

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