Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP Basics: $_GET

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,229
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 30, 2011

$_GET allows values to be read in through the page URL (e.g. index.php?name=Alex). This example shows how to read these in, and how to incorporate a form as to submit these variables.

WEBSITE
http://phpacademy.org

FORUM
http://phpacademy.org/forum

TWITTER
http://twitter.com/phpacademy

FACEBOOK
http://www.facebook.com/group.php?gid=64583401868

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Top Comments

  • I keep getting a syntax error for the $GET variables. It says undefined index, even though nothing is wrong!

  • Notice: Undefined index: age in C:\xampp\htdocs\age.php on line 6

    years old!

    Every time I load up the page I get this error :$

see all

All Comments (41)

Sign In or Sign Up now to post a comment!
  • @KrunalPking that just means the variable is unset. such as in this example..

    echo $var;

    itll give you the same error, all its saying is its unset. you can turn it on by using php.ini or using the php code: error_reporting(0);

  • Is the else command that's not working?

  • @arturoguillen1987 no problem :)

  • @winnervswinner Thank you so much. It works!!!!!!

  • @renatov85 The form syntax is all HTML. I don't think PHP Academy offers tutorials on basic HTML, but I taught myself HTML using html.net

  • What do you mean by "is SET"? I'm having a hard time understanding what "set" is in this context. Obviously the code: If (isset($name) is checking to see if the variable $name is "set" but from what I understand, "set" doesn't mean NOT empty. Alex also has a != empty constraint in the IF statement so kind of confused. Does "set" just mean to exist??

  • Hey I tested all the limits of characters for GET on Firefox, IE, Opera, Chrome and Safari...they all had the same error after 8155...Request to Large...just thought i'd put that out there... :)

  • How can I learn more about this "form" stuff? Which language is this?

  • for the undefined index, you use @ for all . for ex: @$_GET['name']  ;)

  • people who are getting errors, make sure you have the '?name=myname&age=21' in your url

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more