Re: first time session values are not seeting in variable they are setting second

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



in your first file "lgoincheck.php" put on top 

session_start();
 
then it will works hope so, best of luck
best of luck,
Shadman Jamil




________________________________
From: malayappa2000 <malayappa@xxxxxxxxxxxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Friday, February 13, 2009 9:59:22 PM
Subject:  first time session values are not seeting in variable they are setting second

hi fallowing is my logincheck page
---------------------------------
lgoincheck.php

include "config.php";

  $mainU=$_POST['username'];
    $mainP=$_POST['password'];
    $exQ=mysql_query("SELECT * FROM ztext_register WHERE username =
'".$mainU."'" ) or die(mysql_error());
    $fx = mysql_fetch_array($exQ);
    $userid=$fx['userid'];
    $username=$fx['username'];
    $password=$fx['password'];
    $email=$fx['email'];
    $status=$fx['blocked'];
    
    echo "username db is".$username."<br>";
    echo "username  db is".$userid."<br>";
    if($status=='y')
    {
    echo '<script>window.location="blockmsg.php";</script>';
    } 

    if($mainU==$fx['username'])
    {
        if($mainP ==$fx['password'])
        {    
            $_SESSION['userid']=$userid;
            $_SESSION['username']=$fx['username'];
            
            echo '<script>window.location="userhome.php";</script>';
            }            
                
    else
    echo "password not correct";
      echo '<script>window.location="index.php?step=1";</script>';
}
else
echo "user name not correct";
echo '<script>window.location="index.php?step=1";</script>';
      ?>

fallowing is user home page.

-------------------------------

<?php session_start();
include "config.php";
$username=$_SESSION['username'];
echo "$username"."hi";
?>
when i try to login first time iam uable to get the username in
userhome page.

if try to login second time i am able to login 
because firts time session values are not setting .
only second time session values are setting plesae provide some help



------------------------------------

Are you looking for a PHP job?
Join the PHP Professionals directory Now!
http://www.phpclasses.org/jobs/
Yahoo! Groups Links




      

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux