Dynadot โ€” .com Transfer

$_SERVER['PHP_SELF'] problem

SpaceshipSpaceship
Watch

Kadenz

Resistance is FutileEstablished Member
Impact
29
I am having trouble getting a URL, I was wondering if there is a better command than $_SERVER['PHP_SELF'], because if I use that with a URL like index.php?option=com_content&itemid=2
I will get with PHP_SELF
index.php

I want to get the whole URL, how do I do this?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
PHP:
$a = $_SERVER['HTTP_HOST'] // server-name - domain
$b = $_SERVER['PHP_SELF'] // you're page, as you know
$c = $_SERVER['QUERY_STRING'] // everything after the "?",
// but not including the "?"

echo "$a$b?$c";  // would print whole URL

$d = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
// notice the "?" in middle of the above, and variables seprated by dots(.)
// $_SERVER['QUERY_STRING'] reads url GET query, but does not contain
// the "?" in it itself, since "?" is not a variable.

echo $d; // would print the whole URL using above.
 
0
•••
$_server['request_uri'] ?
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
Appraise.net
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back