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.
Results 1 to 2 of 2
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question undefined variable

    Notice: Undefined variable: loggedin in D:\mypubspace.com\wwwroot\mobile\index.php on line 10

    Code:
    <?php include "config.php";
    $loggedIn = (isset($_COOKIE['loggedin']) && $_COOKIE['loggedin'] == 'true')?true:false;
    $query1 = "SELECT DISTINCT rsTown FROM pubs ORDER BY rsTown asc";
    $result = mysql_query($query1);
    
    
    $towns = mysql_query("SELECT DISTINCT RSTOWN, COUNT(PUBID) As PubCount FROM pubs GROUP BY RSTOWN  ORDER BY RSTOWN ASC");
    $counties = mysql_query("SELECT DISTINCT RSCOUNTY, COUNT(PUBID) As PubCount1 FROM pubs GROUP BY RSCOUNTY  ORDER BY RSCOUNTY ASC");
    if ($loggedin == 'true')
    $locals = mysql_query("SELECT * FROM pubs INNER JOIN favepub_copy ON pubs.PUBID=favepub_copy.PUBID WHERE USERID='".$_SESSION['USERID']."' ORDER BY rsPubName asc");
    ?>

    line 10:
    Code:
    if ($loggedin == 'true')

  • #2
    Senior Coder
    Join Date
    Apr 2010
    Posts
    1,411
    Thanks
    68
    Thanked 102 Times in 101 Posts
    The variable isn't the same name, the I needs to be capital. Change to $loggedIn


  •  

    Posting Permissions

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