Connecting Tech Pros Worldwide Forums | Help | Site Map

Header Problem (Its a very urgent).

Newbie
 
Join Date: Oct 2006
Location: Noida
Posts: 21
#1: Nov 23 '06
Hi Everubody,

Code is thois :

<?php
include_once("connection.php");
ob_start();
@session_start();
$ctr="";
$ctr1="";
if($_POST["login_x"]!="")
{
$emp_name=$_REQUEST['emp_name'];
$emp_pass=$_REQUEST['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_query("select * from tb_emp where fld_ename='$emp_name' && fld_passs='$emp_pass' && fld_status='Approved'");
$num1=mysql_num_rows($sql1);
$ress1=mysql_fetch_row($sql1);
$uidd1=$ress1[0];
if($num1 > 0)
{
$_SESSION['empname']="$emp_name";
$_SESSION['eid']="$uidd1";
header("location: my-medscout-emp.php");

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

if($_POST["continue_x"]!="")
{
$_SESSION['price']=$_POST['price'];
$_SESSION['txt']=$_POST['txt'];
header("Location: employee-login-signup.php");
}
## SHOW ALL STATE JOBS ##
$sql12="select fld_state,sum(fld_status) from tb_jobs group by fld_state";
$sql13=mysql_query($sql12);
$query2=mysql_num_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's Avatar
Moderator
 
Join Date: Jul 2006
Location: The Netherlands
Posts: 4,139
#2: Nov 23 '06

re: Header Problem (Its a very urgent).


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:
Newbie
 
Join Date: Oct 2006
Location: Noida
Posts: 21
#3: Nov 24 '06

re: Header Problem (Its a very urgent).


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.
Newbie
 
Join Date: Nov 2006
Posts: 17
#4: Nov 24 '06

re: Header Problem (Its a very urgent).


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
Newbie
 
Join Date: Nov 2006
Posts: 13
#5: Nov 24 '06

re: Header Problem (Its a very urgent).


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("Location: http://www.aaa.ccc/error.php") -not- header("Location: ../error.php")
3. make sure that auto_preped_file on php.ini are empty (not initialized), if initialized, make it empty
auto_preped_file =
then restart your server
Reply