Ez_sql and the header() function

Rate this:
By snak (Contact - View My Woyano)
Published Mon 17 Sep 2007, 463 Views, 3 Comments

Let us say I have the following code in my script:

if(!$RET) header("Location: http://www.mysite/somepage.php?u=$user");
else header("Location: http://www.mysite/someotherpage.php?u=$user");

This works well, jumping to somepage.php if the $RET var = 0 and someotherpage.php if $RET = anything else.

In order to set $RET, I want to look up the existence of $user in a MySQL data table (the $user var exists anyway).

However, as soon as I add 'include "ez_sql.php;" the script stops working complaining that ez_sql has already sent headers.

How do I stop this? 



This Item
Category: Knowledge, Questions, General
Tags: header, redirection, ez_sql
Share it
Link to this item:
Bookmark this item: RSS Feed

People who liked this item

    3 Comments

  1.  
    JV ~ 15 months ago
    0 votes thumbs up thumbs down
    Its probably not ezSQL.

    Do you have a space anywhere being printed out before you call the header function?

    Its usually cased by a spare space before the
    [ reply ]
    1.  
      snak ~ 15 months ago
      0 votes thumbs up thumbs down
      Aha! A superfluous return at the end of the ez_sql.php file. Probably my fault - thanks JV.
      [ reply ]
      1.  
        JV ~ 15 months ago
        0 votes thumbs up thumbs down
        Guessed as much :)
        [ reply ]
        1.  
          22 votes thumbs up thumbs down
          This is my two cents...

             
          Hey you know AdGuy always gets the last word! ;)

        Please Login to Add Your Comment   ..or..  

        Replying to comment by