Jump to content

Why Code Not Grab $GET Data If $_GET Exists ?


phpsane

Recommended Posts

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();
        }
	
Link to comment
Share on other sites

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

  • Barand locked this topic

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.