Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    i cant see where you have session_start() anywhere.

    you cant set session variables without it
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  2. #32
    New Coder
    Join Date
    Oct 2012
    Posts
    29
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    i cant see where you have session_start() anywhere.

    you cant set session variables without it
    I only put session_start() in my check_login.php but not inside my form. Because if i put in inside my form, it only gives me this:
    Code:
    Notice: A session had already been started - ignoring session_start() in C:\xampp\htdocs\test\admin\connect.php on line 2
    also, if i get rid session_start() in my form i only got blank page..

  3. #33
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    i dont see it in your login script
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  4. #34
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Location
    UK
    Posts
    709
    Thanks
    20
    Thanked 84 Times in 84 Posts
    just spotted another error.

    your killing the $row variable here:

    PHP Code:

     $row 
    0//<---------------------------------------
    }

    if ( !empty(
    $row) > 0
    {
    $_SESSION['myusername']=$myusername;
    $_SESSION['profile']=$row['profile']; 
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month

  5. #35
    New Coder
    Join Date
    Oct 2012
    Posts
    29
    Thanks
    10
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arcticwarrio View Post
    just spotted another error.

    your killing the $row variable here:

    PHP Code:

     $row 
    0//<---------------------------------------
    }

    if ( !empty(
    $row) > 0
    {
    $_SESSION['myusername']=$myusername;
    $_SESSION['profile']=$row['profile']; 
    This is where i put the session_start() in my check_login.php
    PHP Code:
    <?php
     session_start
    ();
    $_SESSION['profile'];
    // Connect to server and select databse.
    mysql_connect("localhost""root""")or die("cannot connect"); 
    mysql_select_db("test")or die("cannot select DB");

    // username and password sent from form 
    $myusername=$_POST['myusername']; 
    $mypassword=$_POST['mypassword'];
    ok, already take $row = 0; out from the check_login.php page. It redirect me to the respective pages but when i clicked the form, it still does not appear

  6. #36
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    You need to add proper debugging steps in between the lines of your code.
    Add some echos in each of your conditional blocks and also to the the variables like $row['profile'] to make sure that the execution of the code is how you desired.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


 
Page 3 of 3 FirstFirst 123

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •