Search code examples
phpgetprofile

Using a variable within GET


I'm trying to build something of a profile page, and am having a little bit of trouble. I want it to be so when you're on your own profile you have the ability to edit your profile, but while others those things don't show up, also when you click your name in the navbar it takes you to your specific profile. Here's the Code the I'm stuck on

 if(isset($_GET['$myUsername'])){

}

How do I use a variable within $_GET? Thanks!


Solution

  • Remove single quotation

    if(isset($_GET[$myUsername])){
    // Your Code
    }