Jump to content
php.lv forumi

pasmocits logins


vitao.web

Recommended Posts

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'])){

   ?>

Link to comment
Share on other sites

 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 by Valis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...