anonīms Posted December 14, 2008 Report Share Posted December 14, 2008 (edited) logout.php <?php if(!$logged_in) { header ("Location: ".$BASE.""); } else { if(isset($_COOKIE[$cookie_name])){ setcookie("".$cookie_name."","",time()-$cookie_time); } ?> Kādēļ 10 rindai met erorru par cookie already sent? Apskatijos andrisp rakstu, bet tā īsti neko neatradu. Edited December 14, 2008 by anonīms Link to comment Share on other sites More sharing options...
Aleksejs Posted December 14, 2008 Report Share Posted December 14, 2008 Cookies already sent? Vai headers already sent? Link to comment Share on other sites More sharing options...
marcis Posted December 14, 2008 Report Share Posted December 14, 2008 Cepuma likšana jau arī nozīmē to, ka tiek sūtīts header'is uz brouzeri. Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2008 Report Share Posted December 15, 2008 99.9%, ka pirms tā koda notiek kaut kāda izvade. Parādi konkrētu kļūdas paziņojumu. Link to comment Share on other sites More sharing options...
anonīms Posted December 15, 2008 Author Report Share Posted December 15, 2008 (edited) Warning: Cannot modify header information - headers already sent by (output started at /usr/home/.../www/index.php:22) in /usr/home/.../www/pages/logout.php on line 10 pilns logout.php <?php if(!$logged_in) { header ("Location: ".$BASE.""); } else { /*if(isset($_COOKIE[$cookie_name])){ setcookie("".$cookie_name."","",time()-$cookie_time); } */ /* Kill session variables */ $login = $_SESSION['lietotajvards']; unset($_SESSION['lietotajvards']); unset($_SESSION['parole']); $_SESSION = array(); // reset session array session_destroy(); // destroy session. mysql_query("UPDATE gamefarm_lietotaji SET laiks_kad_iegaja = '' WHERE lietotajvards = '$login'") or die(mysql_error()); echo "<meta http-equiv=refresh content='0;url=".$BASE."'>"; } ?> un vēl config.php failā // ----------------- header ---------------- // header('Cache-control: private'); // IE 6 FIX // always modified header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); // HTTP/1.1 header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); // HTTP/1.0 header('Pragma: no-cache'); Edited December 15, 2008 by anonīms Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2008 Report Share Posted December 15, 2008 Un kas notiek ap 22. rindiņu index.php failā ? Link to comment Share on other sites More sharing options...
anonīms Posted December 15, 2008 Author Report Share Posted December 15, 2008 index.php failā 22 rinda ir <link rel="shortcut icon" href="/design/favicon.jpg" type="image/jpg" /> bet nu pirms tam vēl ir <?php session_start(); $BASE = 'http://www.aaaa.lv'; if(strtolower($_SERVER['HTTP_HOST'])!="www.aaaaa.lv"){ header("Location: http://www.aaaa.lv".$_SERVER['REQUEST_URI']); exit; } include "aaaaaaaaaaaaaaaa/function.php"; include "aaaaaaaaaaaaaaaa/language_switch.php"; include "aaaaaaaaaaaaaaaa/config.php"; include "aaaaaaaaaaaaaaaa/login.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>title</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Link to comment Share on other sites More sharing options...
andrisp Posted December 15, 2008 Report Share Posted December 15, 2008 Nu viss skaidrs - tu to logout.php iekļauj kaut kur index.php failam viducī. Pēc tam, kad jau visādi htmliņi jau izdrukāti. Link to comment Share on other sites More sharing options...
anonīms Posted December 15, 2008 Author Report Share Posted December 15, 2008 (edited) ok thx. likšu sākumā. hmmm, kaut kas nav ar cookijiem pareizi.. uzspiežot iziet viņš neizlagojas, ja ir remember me login.php $remember = $_POST['remember']; if($remember == 1) { setcookie ($cookie_name, 'lietotajvards='.$_POST['user'].'&parole='.$md5pass, time() + $cookie_time); // post ir aizsargats } un logout.php if(isset($_COOKIE[$cookie_name])){ setcookie("".$cookie_name."","lietotajvards=''&parole=''",time()-$cookie_time); } kur varētu būt vaina? Edited December 15, 2008 by anonīms Link to comment Share on other sites More sharing options...
marcis Posted December 15, 2008 Report Share Posted December 15, 2008 setcookie($cookie_name,"",-1,"/"); Link to comment Share on other sites More sharing options...
Recommended Posts