Header Problem (Its a very urgent).

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anis2007
    New Member
    • Oct 2006
    • 21

    Header Problem (Its a very urgent).

    Hi Everubody,

    Code is thois :

    <?php
    include_once("c onnection.php") ;
    ob_start();
    @session_start( );
    $ctr="";
    $ctr1="";
    if($_POST["login_x"]!="")
    {
    $emp_name=$_REQ UEST['emp_name'];
    $emp_pass=$_REQ UEST['emp_pass'];
    $emp_name=trim( $emp_name);
    $emp_pass=trim( $emp_pass);
    //echo "select * from tb_emp where fld_ename='$emp _name' && fld_passs='$emp _pass'";
    $sql1=mysql_que ry("select * from tb_emp where fld_ename='$emp _name' && fld_passs='$emp _pass' && fld_status='App roved'");
    $num1=mysql_num _rows($sql1);
    $ress1=mysql_fe tch_row($sql1);
    $uidd1=$ress1[0];
    if($num1 > 0)
    {
    $_SESSION['empname']="$emp_name" ;
    $_SESSION['eid']="$uidd1";
    header("locatio n: my-medscout-emp.php");

    }
    else
    {
    $msg1="Invalid user/password ";
    }
    }

    if($_POST["continue_x "]!="")
    {
    $_SESSION['price']=$_POST['price'];
    $_SESSION['txt']=$_POST['txt'];
    header("Locatio n: employee-login-signup.php");
    }
    ## SHOW ALL STATE JOBS ##
    $sql12="select fld_state,sum(f ld_status) from tb_jobs group by fld_state";
    $sql13=mysql_qu ery($sql12);
    $query2=mysql_n um_rows($sql13) ;
    ?>

    if i run this code in our server, then no problem.
    But, In client server, this is show following error.

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/n/i/bniceaa/html/connection.php: 1) in /home/content/b/n/i/bniceaa/html/buy-job-posting.php on line 36

    Plz help me.
    Regarsd
    Anu2007
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Anis2007: you are really hard-headed! It appears that you have a lot of header problems, You already have 4 threads in this forum with the same problem "Header problem" and they are always urgent. Don't you think it is time that you'd follow the advice from your forum co-members regarding these problems or took some tutorial so you'd understand the header problems that keep popping up for you all the time?

    Also, after starting 10 or so threads you know, and you have been told before, that you should put your code in php, code or html tags. You are seeking help here but you don't want to comply to a few simple rules that makes it easier for all members to help each other.

    I most strongly suggest that you take a tutorial on headers and their workings, so you can understand the background of your continuous headers problem. When you have that background, it makes it easier for everyone to discuss these problems with you.

    Ronald :cool:

    Comment

    • anis2007
      New Member
      • Oct 2006
      • 21

      #3
      First of all i would like to say thanks very much for response.
      then secondaly, i have post this problem four times, but i can't got my answer.
      my question was, wht wrong with this code, because this is running on our server, but this is not run on my client server,
      Plz help me sir.
      Thanks in Advance.

      Comment

      • gm04030276
        New Member
        • Nov 2006
        • 17

        #4
        two things,

        1: does your page have anything else on it apart from the php code, ie, is there any html in your page as well and
        2: make sure your <?PHP tag is at the very begining of the file, ie no white space above it and not spaced or tabbed in.

        these are problems i've had in the past and learnet from

        Comment

        • theRamones
          New Member
          • Nov 2006
          • 13

          #5
          what is the problem :
          1. is your code parse error, or
          2. the redirect page that you wanted doesn't work

          things that need to remember where u want use header, especcialy for redirection :

          1. make sure your header must on the TOP OF THE LINE of your code.
          2. make sure the url location must be true (not page not found). i suggest u use ABSOLUTE URL, header("Locatio n: http://www.aaa.ccc/error.php") -not- header("Locatio n: ../error.php")
          3. make sure that auto_preped_fil e on php.ini are empty (not initialized), if initialized, make it empty
          auto_preped_fil e =
          then restart your server

          Comment

          Working...