vitao.web Posted July 15, 2010 Report Share Posted July 15, 2010 Problema tada, ka es piemeram ja ieeju ieksa svs/index.php ( tas mans logins..pie tam ja esmu jau agrak ielogojies) tad man radas vnk tuksa lapa, bet man vajag lai automatiksi parmet uz home.php bet nezinu kur tiesi vaina :( <?php // Including session, configuration files require_once "../lib/cfg.php"; require_once "../lib/session.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>SDFHI CMS | Login</title> <link rel="stylesheet" href="../css/svs.css" type="text/css" /> </head> <body> <?php // Set user and password $user = "xxxx"; $password = "xxx; // Check if user and password match if($_POST['user'] == $user && $_POST['password'] == $password){ $_SESSION['logged'] = 1; // If they match go to svs main page header( "Location: home.php" ); } // if password and user is correct login if(!isset($_SESSION['logged'])){ ?> Quote Link to comment Share on other sites More sharing options...
Valis Posted July 15, 2010 Report Share Posted July 15, 2010 (edited) Te: if($_POST['user'] == $user && $_POST['password'] == $password){ Kad ieej no jauna, tu jau nesūti nekādus POST datus. Tāpēc tavā situācijā vajadzētu - if($_POST['user'] == $user && $_POST['password'] == $password){ $_SESSION['logged'] = 1; } if ($_session['logged']) header('..') else "login page" Edited July 15, 2010 by Valis Quote Link to comment Share on other sites More sharing options...
_siikais_ Posted July 15, 2010 Report Share Posted July 15, 2010 pirms header nedriikst buut nekaadi outputi 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.