Jump to content


Photo

header problem i am getting frustrated now


  • Please log in to reply
4 replies to this topic

#1 truenitin

truenitin
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 05 July 2006 - 12:42 PM

hiii

i am using php5
apache 2

the following line of  code

header("location:login_success.php")

gives the error

header already sent

i tried ob_end_flush also , removed all the blank spaces also everything but it still keeps popping up

Nitin

This is an SOS

#2 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 05 July 2006 - 12:43 PM

Can you post the full script?

Also, read here:
http://www.phpfreaks...ic,37442.0.html

Orio.
Think you're smarty?

(Gone until 20 to November)

#3 truenitin

truenitin
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 05 July 2006 - 12:49 PM

hii this is the script i am using

<?php
ob_start();
require("data_conn.php");
ob_end_flush();
?>
<?php
ob_start();
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$sql="SELECT * FROM members where username='$myusername' and password='$mypassword'" ;
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
//session_register("myusername");
//session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";
}
ob_end_flush();
?>


i removed the session_register because it is also giving me the same error
will sort that out when i get to the root of the problem.

I am calling the above script in the form

Nitin

Nitin

#4 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 05 July 2006 - 12:52 PM

Why do you use the ob_start and ob_end_flush functions? And does data_conn.php output anything?
Also make sure data_conn.php doesnt have any white spaces before the opening <?php and after the closing ?>

Orio.
Think you're smarty?

(Gone until 20 to November)

#5 truenitin

truenitin
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 05 July 2006 - 01:08 PM

hiii orio

thank  you very much

Data_conn had some white spaces i removed them

and it is working fine ....


Thank you very much

Nitin




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users