URL Reconstruction Using PHP
Reconstruct an URL in PHP by concatenating the domain-name, path and query string from three different variables.
|
On Wednesday, April 23rd 2008 at 10:46 PM By Andrei Pociu (View Profile)
    (Rated 0 with 0 votes) |
Contextual Ads
More PHP Resources
Advertisement
// Domain-name
$Domain = $_SERVER['HTTP_HOST'];
// File Path
$Path = $_SERVER['SCRIPT_NAME'];
// Query String
$QString = $_SERVER['QUERY_STRING'];
// Put together the three strings
$URL = "http://".$Domain.$Path."?".$QString; // Or use $_SERVER['REQUEST_URI'] to get the path and query string together
|
Digg It!
Del.icio.us
Reddit
StumbleIt
Newsvine
Furl
BlinkList
|
|
Rate this code snippet
Current Comments
There are no comments.
|
Related Source Code
There is no related code.
Related Tutorials
There are no related tutorials.
PHP Job Search
|