ziedinjsh Posted November 19, 2009 Report Share Posted November 19, 2009 (edited) index.php session_start(); $password = "nekas"; if (isset($_POST['enter'])){ if ($password == $password) { echo "<span style='color:#000000'><b>parole nepareiza</b></span>"; }else{ $_SESSION['producer'] = $row['p']; echo "<meta http-equiv='refresh' content='0;url=page.php'>"; } } echo "<form method='POST' action='".$_SERVER['PHP_SELF']."'>"; echo "<input type='password' name='password'>"; echo "<input type='submit' name='enter' value='Enter'>"; echo "</form>"; page.php session_start(); if ($_SESSION['p']){ echo "esmu iekša"; echo "<a href='logout.php'>Iziet</a>"; }else{ echo "<meta http-equiv='refresh' content='0;url=index.php'>"; } man visu laiku rāda ka ir nepareiza parole kas pa vainu Paldies jau iepriekš :) Edited November 19, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 19, 2009 Report Share Posted November 19, 2009 Tas tādēļ, ka ļoti savdabīga programmas loģika... if ($password == $password) { // Ja mainīgajā $passsword ir ierakstīts tas pats, kas mainīgajā... $password echo "<span style='color:#000000'><b>parole nepareiza</b></span>"; //Tad pateikt, ka parole nav pareiza }else{//Bet visos gadījumos, kad $password nesakrīt pats ar sevi uzskatīt, ka parole ir varen laba Quote Link to comment Share on other sites More sharing options...
ohmygod Posted November 19, 2009 Report Share Posted November 19, 2009 LOOOOOOOL if ($password == $password) Quote Link to comment Share on other sites More sharing options...
Val Posted November 19, 2009 Report Share Posted November 19, 2009 (edited) Pareizas paroles gadījumā vajag uzsetot $_SESSION['p'] tik un tā. Edited November 19, 2009 by Val 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.