login08 Posted November 15, 2008 Report Share Posted November 15, 2008 (edited) Problema sekojosa: ir izveidota autorizacija (login, pass). Autorizejoties lapa atveras(itka vis pareizi), bet lidz ko megina izdarit kadu funkciju vai kaut vai "refresh" lapu, ta izmet atkal autorizaciju (login, pass). Nesaprotu kas par vainu. Lugsu jusu palidzibu. <?php session_start(); // Sākam ielogošanos if (isset($_POST['username'])) { $username= $_POST['username']; $password= $_POST['password']; $username = stripslashes($username); $password = stripslashes($password); #$username = mysql_real_escape_string($username); #$password = mysql_real_escape_string($password); // Pārbaudam lietotajvārdu un paroli if ($_POST['username'] == 'abc' and $_POST['password'] == 'abc') { $_SESSION['authorized'] = TRUE; }} // Izlogošanās if (isset($_REQUEST['logout'])) { unset($_SESSION['authorized']);} // Ja lietotājvārds / parole ir pareizi, tad if (isset($_SESSION['authorized'])) { echo '<center><a class="main2" href="logout.php">Iziet</a></center>'; ?> kods kuru izpilda ja autorizacija pareiza <? } else { kods ja nepareiza }?> PS. Varbut vaina ir hostinga? Edited November 15, 2008 by login08 Link to comment Share on other sites More sharing options...
anonīms Posted November 15, 2008 Report Share Posted November 15, 2008 (edited) Tev jau nav pārbaude, kas pēc refresha pārbauda vai lietotājs ir ielogojies. btw, man te ir viens login kods, paskaties, varbūt kaut kas noder. http://paste.php.lv/8424?lang=php Edited November 15, 2008 by anonīms Link to comment Share on other sites More sharing options...
login08 Posted November 15, 2008 Author Report Share Posted November 15, 2008 (edited) Hmm.. neredzu tava koda refresh parbaudi! Varbut es kludos, bet manuprat tas nav vajadzigs (session). Kluda ir citur! Uz localhost kods stradaja, ieliku hostinga (so to pamainiju) un vairs neiet!! Divi varianti vai nu es esmu stulbs, vai hostings :) Edited November 15, 2008 by login08 Link to comment Share on other sites More sharing options...
Recommended Posts