sunnynosid
02-26-2012, 05:36 AM
This is my code to redirect to a different page when a row is deleted:
<?
session_start();
if($_SESSION[count]!==1){header("Location:http://www.mysite.com/mainsite/LoginReg/Login/loginform.php");};
$surity=$_POST['surity'];
echo"$surity";
mysql_connect('localhost', 'user', 'password') or die (mysql_error());
mysql_select_db('mydb') or die (mysql_error());
if($surity=yes){
$sql="DELETE FROM table WHERE Username='$_SESSION[username]' AND Password='$_SESSION[password]'";
mysql_query($sql);
header("location:http://www.mysite.com/mainsite/DelAcc/accdeleted.php");
}else{header("location:http://www.mysite.com/mainsite/DelAcc/accnotdeleted.php");};
mysql_close();
?>
But i am getting following error:
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/mainsite/DelAcc/delaccscript.php:6) in /home/user/public_html/mainsite/DelAcc/delaccscript.php on line 13
Please tell me where the problem is?:mad:
<?
session_start();
if($_SESSION[count]!==1){header("Location:http://www.mysite.com/mainsite/LoginReg/Login/loginform.php");};
$surity=$_POST['surity'];
echo"$surity";
mysql_connect('localhost', 'user', 'password') or die (mysql_error());
mysql_select_db('mydb') or die (mysql_error());
if($surity=yes){
$sql="DELETE FROM table WHERE Username='$_SESSION[username]' AND Password='$_SESSION[password]'";
mysql_query($sql);
header("location:http://www.mysite.com/mainsite/DelAcc/accdeleted.php");
}else{header("location:http://www.mysite.com/mainsite/DelAcc/accnotdeleted.php");};
mysql_close();
?>
But i am getting following error:
Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/mainsite/DelAcc/delaccscript.php:6) in /home/user/public_html/mainsite/DelAcc/delaccscript.php on line 13
Please tell me where the problem is?:mad: