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
    New Coder
    Join Date
    Sep 2012
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')'

    PHP Code:
    <?php

    session_start
    ();

    if(isset(
    $_GET['username'])){
        
    $profile_name $_GET['username'];
    {

    if(isset(
    $_SESSION['username']==$profile_name)){
            
    $pageOwner true;
    {

    if (
    $pageOwner=="true"
    echo 
    "This is your profile!";

    }
    }
    ?>
    I get the error 'Parse error: syntax error, unexpected T_IS_EQUAL, expecting ',' or ')' ' on line 10.

    What is wrong?

    Thanks

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    You cannot do this: if(isset($_SESSION['username']==$profile_name)){ . That should be if (isset($_SESSION['username']) && $_SESSION['username'] == $profile_name).
    Note you have a lot of opening braces here as well. While it is legal in PHP to have open braces without any control structure or code points, it is illegal to have them without closes. So even after fixing the above, you'll likely have an error on $end. Remove the two open braces that have no control blocks.

  • Users who have thanked Fou-Lu for this post:

    penny94 (09-27-2012)


  •  

    Posting Permissions

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