Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting info from url

Status
Not open for further replies.

richclever

IS-IT--Management
Oct 5, 2000
127
FR
Hi,

I have a url that I need to get info from. If I have a page called how do I get a php function running in this page to return the value of id (54). I need this value to query a database when I am in the page in question.

Thanks

Rich
 
Code:
<?php
  echo $_GET['id'];
?>
Will display your id value.
 
Thanks a lot, I knew it must be quite simple. Presumably I can put that into a variable with

<?php
$idvalue = $_GET['id'];
?>

Rich
 
When you then wish to run some queries on the querystring variables, remember to ensure that there is no malicious content of the variable.

You can do this by escaping characters, removing tags, trimming the variables, etc.

strip_tags(trim(etcetc..

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top