[Solved] URL Question? (Ref: blah.php?value=foo)

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
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

[Solved] URL Question? (Ref: blah.php?value=foo)

Post by Dale »

I'm just wondering is there another way of getting the value from a URL?

Normally I just print the value like so:
URL: http://www.dalehay.com/comment.php?story=78
To show the value (78):

Code: Select all

<?php print $story; ?>
However is there another way of doing this??
Last edited by Dale on Thu Feb 16, 2006 9:49 am, edited 1 time in total.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

You really should do it like this:

Code: Select all

echo $_GET['story'];
Dale
Forum Contributor
Posts: 466
Joined: Fri Jun 21, 2002 5:57 pm
Location: Atherstone, Warks

Post by Dale »

Knew it was something like that. Cheers!

:D
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Dale wrote:Knew it was something like that. Cheers!

:D
Search the forum for "Register Globals" and you'll find why ;) It's not healthy :)
Post Reply