Zdravim.
Neviem preco, ale na mojom localhoste zrazu z nicoho nic nemozem poslat informacie cez header (na presmerovanie), pretoze v kode mam session_start.
Len tak som skusil session_start a vsetky registracie premmennych pod nim presunut v kode pod cast s header, ale aj tak tam bol problem (o tom, ze by to potom vobec nefungovalo nehovorim).
A ked som to spustil na hostingu, tak to bezalo bez akychkolvek problemov.
Nastavenia apache som nemenil, tak neviem preco to zrazu zo dna na den nefunguje.
Este poslem kod, ak by to niekoho zaujimalo, ale neviem ci to ma vyznam
session_start();
if(!session_is_registered("db_pswd")) { session_register("db_pswd"); }
if(!session_is_registered("user_nick")) { session_register("user_nick"); }
if(!session_is_registered("user_pswd")) { session_register("user_pswd"); }
if(!session_is_registered("user_name")) { session_register("user_name"); }
if(!session_is_registered("user_id")) { session_register("user_id"); }
if(!session_is_registered("user_team")) { session_register("user_team"); }
$_SESSION["user_pswd"] = $_POST["pswd"];
$link = mysql_pconnect(nepodstatne);
$db = mysql_select_db(nepodstatne, $link);
if($action == 'login')
{
if($_POST["nick"] <> "")
{
$query = "SELECT * FROM jazdci WHERE login = \"$_POST[nick]\"";
$result = mysql_query($query ,$link);
while($row=mysql_fetch_object($result))
{
$_SESSION["user_name"] = $row->meno;
$_SESSION["user_nick"] = $row->login;
$_SESSION["db_pswd"] = $row->heslo;
$_SESSION["user_id"] = $row->ID_jazdca;
}
mysql_free_result($result);
if($_SESSION["db_pswd"] == $_SESSION["user_pswd"])
{
header("location: ./index.php?action=play");
}
else
{
header("location: ./index.php?action=error1");
}
}
else
{
header("location: ./index.php?action=error2");
}
}
Za rady dakujem