+ Reply to Thread
Results 1 to 1 of 1

Thread: Another Person with Session troubles :|

  1. #1
    MrWicked is offline x10Hosting Member MrWicked is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    3

    Another Person with Session troubles :|

    Alright well i have went over alot of other posts as to people running into session issues in there login scripts.

    I am currently in the same boat, I have read that registered globals is disabled. I have session start at the very beginning of all my pages...

    The login script takes user input stores it in sessions and redirects them to the index page.. Now the index page can access the user name session variable like such

    Code:
    if(!empty($_SESSION['user'])){
            $Username = $_SESSION['user'];
    Now that all works fine but, I have another page that I need to access that session variable from as well.. The other page has the session_start at the top as well but it constantly tells me that i am not logged in, because its not reading my session data :S

    Source

    Code:
    <?php
    session_start();
    
    mysql_connect("local", "***********", "********") or die(mysql_error());
            mysql_select_db("*************") or die(mysql_error());
            $RatingA = $_GET["R"];
            $ID= $_GET["ID"];
            $IP = getenv("REMOTE_ADDR");
            if(is_numeric($ID)) {
            $SID = SanitizeVariable($ID);
            $query = mysql_query("SELECT * FROM `ServerInformation` WHERE ID = '". $SID . "'") or die(mysql_error());
            while($row = mysql_fetch_assoc($query)) {
            $Rating = $row['Rating'];
            $NumberVotes = $row['NumVotes'];
            $ServerName = $row['Name'];
            }
            if(!empty($_SESSION['user'])){
            $Username = $_SESSION['user'];
            $SUsername = SanitizeVariable($Username);
            $SServerName = SanitizeVariable($ServerName);
            if(is_numeric($RatingA)) {
    Why dosent it read the variable, the other page reads it no problem... AHHH

    This all worked on my old host flawlessly, but not here =\
    Edit:
    Ok so it turned out to be something different, a function was stopping the session from grabbing the variable but why would the "is_numeric" function not work :S
    Last edited by MrWicked; 12-07-2007 at 01:20 PM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. Session variables not working
    By os242 in forum Scripts & 3rd Party Apps
    Replies: 12
    Last Post: 10-19-2007, 05:41 AM
  2. Free MMORPG's...
    By FeestBijtje in forum Gamer's Lounge
    Replies: 15
    Last Post: 09-20-2007, 01:51 PM
  3. Session save path in Mambo... always "unset"
    By DizzyTechnology in forum Free Hosting
    Replies: 0
    Last Post: 04-09-2007, 11:04 AM
  4. A person on AIM...
    By MicrotechXP in forum Feedback and Suggestions
    Replies: 6
    Last Post: 06-27-2005, 06:16 PM
  5. Person above me
    By n4tec in forum Off Topic
    Replies: 0
    Last Post: 04-17-2005, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers