Warning: Cannot add header information
| From: | Barra Home - Root | Date: | Thu, 13 Sep 2001 04:46:57 +0000 |
| Subject: | Warning: Cannot add header information | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-13780@lists.php.net to get a copy of this message | ||
Tengo este problema , cuando el user se loguea a traves de un Form lo tiene que redireccionar a una
url , y tonces uso el Header , pero me dice
Warning: Cannot add header information - headers already sent by (output started at
/home/httpd/vhost/hosting/html/Login.php:20) in /home/httpd/vhost/hosting/html/Login.php on line 21
Aca les pasteo el Login.php
<?
$connection = mysql_connect("localhost", "root", "uksuvaso")
or die ("Couldn't connect to server.");
$db = mysql_select_db("kzt_secret", $connection)
or die ("Couldn't select database.");
$sql = "SELECT id
FROM kzt_secret
WHERE IDUser='$IDUser' and IDPass='$IDPass'";
$result = mysql_query($sql)
or die("Couldn't execute query.");
$num = mysql_numrows($result);
if ($num == 1) {
header("Location: $IDRedir");
} else if ($num == 0) {
echo "You are not authorized!";
}
?>