How do I write a $_GET

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silent_assassin
Forum Newbie
Posts: 8
Joined: Mon Mar 20, 2006 5:47 pm

How do I write a $_GET

Post 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
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post 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...
silent_assassin
Forum Newbie
Posts: 8
Joined: Mon Mar 20, 2006 5:47 pm

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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'];
?>
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Have a look over at our Useful Posts Thread
Post Reply