Page 1 of 1

page redirect

Posted: Wed Aug 19, 2009 7:13 am
by yasir_memon
i am sending is total php code before this i used only html code so kindly tell me where i am sending header before if condition or any white space waiting for repli

this warnig message is occuring

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\RMS\login.php:8) in C:\wamp\www\RMS\login.php on line 97


<?php
$A=$_POST["text1"];
$B=$_POST["text2"];
$conn=odbc_connect('AKTMAPP','ERP_TEST','ERP_TEST');
$sql="SELECT 1 A FROM USERS WHERE USR_NAME='$A' and PASSWORD='$B'";
$rs=odbc_exec($conn,$sql);
$count = odbc_result($rs,"A");
if($count>0)
{
header("Location: login.php");
}
else
{
echo "invalid user name or password";
}
odbc_close($conn);
?>

Re: page redirect

Posted: Wed Aug 19, 2009 7:55 am
by yacahuma
This message only occurs if for any reason any characters are output before the header. Do a VIew Source on youyr browser and see if you see anything strange(like an error message). Also make sure that if you have any includes, they do not produce any characters. A common problem is when you have a file and close it with ?> but then enter a couple of empty lines.

Re: page redirect

Posted: Wed Aug 19, 2009 9:55 am
by pickle
Double post.

Locked.