Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[php]$_get

Skilled Illusionist
Joined
Jan 14, 2005
Messages
395
Reaction score
2
hello,
i am working with $_GET but i don't get how to this :

if someone visit for example : name.php?name

how to use that value after '?' i tried this :

PHP:
<?php
echo 'Hello ' . $_GET['?'] . '!';
?>

hope someone can help me !

greets passie
 
Newbie Spellweaver
Joined
Sep 28, 2007
Messages
64
Reaction score
0
Below will only set the $_GET data, but there is no actual data to show:

Code:
name.php?name

You would need something like...

Code:
name.php?n=George

Then the php would be like so:

PHP:
<?php
echo 'Hello ' . $_GET['n'];
?>

In the url "name.php?n=George" it works as such:

name.php - File name
n - $_GET name
George - $_GET value

So this url:

Code:
info.php?name=Luke&age=23&country=England&area=Leicester

Would give my details in this php

PHP:
<?php
echo 'Your name is ' . $_GET['name'] . ' and you are ' . $_GET['age'] . ' years of age.<br />';
echo 'You live in ' . $_GET['area'] . ' which is in ' $_GET['country'];
?>

That would output

Code:
Your name is Luke and you are 23 years of age.
You live in Leicester which is in England.
 
Newbie Spellweaver
Joined
Jun 12, 2006
Messages
13
Reaction score
0
? is for declare variable, like $, but is for URL
 
Back
Top