Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   header (https://forum.antichat.xyz/showthread.php?t=98736)

barnaki 30.12.2008 23:36

header
 
вообщем такая проблема.
есть скрипт
<?php
ob_start();
include_once "functions.php";
include_once "db_config.php";

$name = htmlspecialchars($_POST['name']);
$city = htmlspecialchars($_POST['city']);
$email = htmlspecialchars($_POST['email']);
$url = htmlspecialchars($_POST['url']);
$msg = htmlspecialchars($_POST['msg']);

$time =mysql_query("SELECT NOW();");
$puttime = mysql_result($time,0);
if(!$puttime)
{
$puttime= "0000 00 00 00:00:00";
}
$add_query = "INSERT INTO guest VALUES(0,'$name','$city','$email','$url','$msg','$ puttime','show')";
if (!mysql_query($add_query))
{
echo "cant write message";
}

header ("Location : http://banderas/fuck/index.php");
exit;

?>
в нем не работает header ("Location : http://banderas/fuck/index.php"); .
как заставить его перейти ?

preda1or 30.12.2008 23:39

<?php
ob_start();
include_once "functions.php";
include_once "db_config.php";

$name = htmlspecialchars($_POST['name']);
$city = htmlspecialchars($_POST['city']);
$email = htmlspecialchars($_POST['email']);
$url = htmlspecialchars($_POST['url']);
$msg = htmlspecialchars($_POST['msg']);

$time =mysql_query("SELECT NOW();");
$puttime = mysql_result($time,0);
if(!$puttime)
{
$puttime= "0000 00 00 00:00:00";
}
$add_query = "INSERT INTO guest VALUES(0,'$name','$city','$email','$url','$msg','$ puttime','show')";
if (!mysql_query($add_query))
{
echo "cant write message";
ob_flush();
die();
}

header ("Location: http://google.ru");
ob_flush();
die();

?>

попробуй
а вообще до header не должно быть никакого вывода

barnaki 31.12.2008 00:05

все дело в пробеле
header("Location: http://banderas/fuck/index.php");
а не
header("Location : http://banderas/fuck/index.php");
ну и жесть


Время: 10:43