Page 1 of 1

How do I write a $_GET

Posted: Mon Mar 20, 2006 6:18 pm
by silent_assassin
New to PHP and was wondering how I would write a $_GET to allow me to create a hyperlink and then the hyperlink I would put in. Thanks

Posted: Mon Mar 20, 2006 6:23 pm
by evilmonkey
Not quite sure what you mean by that, but you can always get the contents of $_GET using $_SERVER['QUERY_STRING']. Hope that helps...

Posted: Mon Mar 20, 2006 6:26 pm
by silent_assassin
Sorry,

Wot I mean is i am wanting to create a hyperlink which will appear as index.php?=page or however it is and have no idea how to write it. What I am after is an example of how to do it please.

Cheers

Posted: Mon Mar 20, 2006 7:01 pm
by RobertGonzalez

Code: Select all

<a href="somelink.php?var=value">CLICK THIS LINK!</a>
Then get the var value like this...

Code: Select all

<?php
$qs_var_value = $_GET['var'];
?>

Posted: Mon Mar 20, 2006 10:01 pm
by John Cartwright
Have a look over at our Useful Posts Thread