ziedinjsh Posted February 7, 2011 Report Share Posted February 7, 2011 skatījos jau postus par login.php, bet vienalga nesaprotu kur ir problēma manējā! if(isset($_POST['login'])){ $user_email = $_POST['user_email']; $user_pass = md5($_POST['user_pass']); $user_email = stripslashes($user_email); $user_pass = stripslashes($user_pass); $user_email = mysql_real_escape_string($user_email); $user_pass = mysql_real_escape_string($user_pass); $sql = "SELECT * FROM users WHERE user_email='$user_email' and user_pass='$user_pass'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count==1){ $_SESSION['user_email'] = $user_email; echo "<meta http-equiv='refresh' content='0;url=index.php'><img src='img/loader.gif'><br>"; } else { echo "<spna style='color:#ff0000;font-weight:bold;margin-bottom:10px;'>Nepareizs e-pasts un/vai parole!"; } } Quote Link to comment Share on other sites More sharing options...
Vecteevs Posted February 7, 2011 Report Share Posted February 7, 2011 (edited) nez, bet tu šiem $user_email = $_POST['user_email']; $user_pass = md5($_POST['user_pass']); $user_email = stripslashes($user_email); $user_pass = stripslashes($user_pass); $user_email = mysql_real_escape_string($user_email); $user_pass = mysql_real_escape_string($user_pass); liec vienadus mainiigo nosaukumus. Tev tur manuprāt pietiktu tikai ar mysql_real_escape_string un tam ir jaiskatās tā $user_email = mysql_real_escape_string($_POST['user_email']); $user_pass = mysql_real_escape_string($_POST['user_pass']); $pass_hash = md5($user_pass); $sql = "SELECT * FROM users WHERE user_email='$user_email' and user_pass='$pass_hash'"; Edited February 7, 2011 by Vecteevs Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 7, 2011 Author Report Share Posted February 7, 2011 labi, izdarīju tā, bet vienalga neiet.. vnk refrešojas un viss.. neielogojas un nekādus errorus, notices vai warningus neizmet! Quote Link to comment Share on other sites More sharing options...
rebuilder Posted February 7, 2011 Report Share Posted February 7, 2011 Ja jau norefreshojas, tad esi ielogojies ;) Pamēģini izvadīt $_SESSION['user_email'] Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 7, 2011 Author Report Share Posted February 7, 2011 tā, jā izvada e-pastu.. laikam jāuzliek header uz index.php Quote Link to comment Share on other sites More sharing options...
Kemito Posted February 7, 2011 Report Share Posted February 7, 2011 Nevis "laikam", bet vaig. Takš padomā loģiski, tu taču uzsāc sessiju, bet lapa nav pārlādēta, līdz ar to, tu neredzi DATUS savus, ko esi iedevis tam, ja sessija ir uzstādīta vai ne tā? Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 7, 2011 Author Report Share Posted February 7, 2011 tā, bet man jau refrešojas.. tad ja ielogojas vajadzētuieiet lapā.. tātad.. kļuda man ir šeit kkur: if(!isset($_SESSION['user_email'])){ include("login.php"); } else { session_start(); include("menu.php"); } Quote Link to comment Share on other sites More sharing options...
daGrevis Posted February 7, 2011 Report Share Posted February 7, 2011 Ir taču jādomā līdzi! =P Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 7, 2011 Author Report Share Posted February 7, 2011 headera vietā es uzliku šo <meta http-equiv='refresh' content='0;url=index.php'> ja ielieku header("Location:index.php"); tad ir Warning: Cannot modify header information - headers already sent by (output started at D:\WEB\xampp\htdocs\forums\header.php:138) in D:\WEB\xampp\htdocs\forums\login.php on line 27 Quote Link to comment Share on other sites More sharing options...
Kemito Posted February 7, 2011 Report Share Posted February 7, 2011 Ziedinjsh, tu vispār forumā uzturies? Kā jau trilijons reižu pieminēti iemesli, kapēc met šo Brīdinājumu, kā arī, ja nemaldos pat bija pieknaģota viena saraksta par to. Un to ielogošanos manuprāt vari iemest kādam kaķim bļodiņā, lai apēd viņu. AGAIN AGAIN AND AGAIN - Power of future is ID !!!!!!!! Izlasi, ko forSilance ( atvaino ja kļūdos par segvārdu ) ir teicis / prasījis / jautājis utml. par autorizācijas lietām. Kungs dievs, manuprāt to ko briedis teica vienā sarakstē ( topikā ) par šo cilvēku, ir tomēr 100% taisnība. Quote Link to comment Share on other sites More sharing options...
aaxc Posted October 8, 2012 Report Share Posted October 8, 2012 Tu sesiju sāc tikai tad, kad tev ir errors. No kurienes tev scripts redzēs $_SESSION['user_email'] mainīgo, ja sesija nav atvērta? session_start(); if(!isset($_SESSION['user_email'])){ include("login.php"); } else { include("menu.php"); } Un par headeriem paskaties šo pašu forumu, ir liels raksts par header already sent kā tats pirmais izceltais! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.