phpsane Posted October 24, 2018 Share Posted October 24, 2018 (edited) Folks, Why code not grab $GET data if it exists ? Valid Url Format: domain.com/register.php?sponsor_username=barand Invalid Url Format as Sponsor Username does not exist in url: domain.com/register.php $url = "$_SERVER["QUERY_STRING"]"; echo "$_SERVER["QUERY_STRING"]"; echo "$url"; echo htmlspecialchars($_GET["sponsor_username"]); if(strpos($url,'sponsor_username=') !== false) { $sponsor_username = $_GET["sponsor_username"]; } elseif ($sponsor_username == "") { echo "Signups only through invitations only. <br> Therefore, you need to be invited by a registered person who knows you!"; exit(); } Edited October 24, 2018 by phpsane Link to comment Share on other sites More sharing options...
Barand Posted October 24, 2018 Share Posted October 24, 2018 11 hours ago, phpsane said: Why code not grab $GET data if it exists ? Because you are still incapable of writing the simplest lines of code correctly. There is nothing wrong with above code that you haven't been told about previously. I recommend you read through replies to your previous topics and try something new - like learning the basics. Link to comment Share on other sites More sharing options...
Recommended Posts