Jump to content

getting info from a url


Canadiengland

Recommended Posts

Values on the URL are passed to your script via the $_GET superglobal array. In your case you would access it by

<?php
$itemid = $_GET['itemid'];
?>

 

If you want to see all the values in the $_GET array, do this at the start of your script:

<?php
echo '<pre>' . print_r($_GET,true) . '</pre>';
?>

 

Ken

You can also use parse_str() on $_SERVER["QUERY_STRING"] for a register globals effect, getting the query string is generally easy if you're only passing one value to the script, but if you're using it with parse_str it's frowned upon and begs for injection.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.