User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,534 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,027 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Can a text link pass php variables?

Join Date: Aug 2006
Posts: 138
Reputation: php_daemon is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 2
php_daemon php_daemon is offline Offline
Junior Poster

Re: Can a text link pass php variables?

  #8  
Jan 10th, 2007
Originally Posted by nathanpacker View Post
[...] I just realized that it is a variable. I can just use it like any other variable![...]

Note that register_globals can be turned off, and is off by default in later PHP versions as it's considered a bad practice. Use $_GET superglobal instead.

Also don't forget to validate the user input. In this case id is integer value so the correct access should be:
[php]
$id=(int)$_GET['id'];
[/php]

If it's not numerical, use mysql_real_escape_string() before putting them into your queries.
Reply With Quote  
All times are GMT -4. The time now is 4:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC