Rated an average of 4 stars by 2 people

Alternative $_get[]

Script Details:
Added on March 14, 2009 by Speedy. Last modified March 14, 2009.
Speedy accreditted the script to himself.

Description:
We all know how urls often looks like this: filename.php?id=x well, in this script I will show you how to do it like this: filename.php?id.x

Tags: $_get[], alternative, url

Instructions:
Add this to the top of the page

Code:

<?php
# Snippet from PHP Share: http://www.phpshare.org

$id end(explode('.'$_SERVER['REQUEST_URI']));
// Lets say that the URL was user . php ? id . 234
// $id now holds the value 234
// This is best on one line because you can bring in
// the $id variable anywhere on the site aslong as its inside a PHP tag:)
    
echo $id;
// Let's just test that it works:)
    
?>

Review this PHP Script:

Rating:

Comments:




Comments

  • July 22, 2009
    Zhay
    What need does this script fulfill?

Login

User:
Pass:

Register

Not a member? Register today and receive the many free benefits of being a member!

Advertisements