Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [PHP] Displaying the full Address Bar value in Webpage
New Posts  All Forums:Forum Nav:

[PHP] Displaying the full Address Bar value in Webpage

post #1 of 3
Thread Starter 
Basically I want to grab the entire address bar words into a variable and echo th e whole thing out onto the screen. The PHP documentation is confusing me.

so if the address is "http://www.example.com/example.php?one=one&two=two"

i want to echo (print) the whole thing out onto the screen.
I LOVE 939
(13 items)
 
  
CPUMotherboardGraphicsRAM
Opteron 170 CCBWE 0550 UPMW ASUS A8N-SLI Deluxe EVGA 8800GT 2GB CorsairTwinX DDR500 CL3 
Hard DriveOptical DriveOSMonitor
WD250gig + WD500gig LG DVD-RAM/-R/+R/-RW x 2 Vista Ultimate Dell 20.1" Widescreen 
KeyboardPowerCaseMouse
Microsoft Cordless Hiper 580W Type-R ASUS Vento 3600 Black Logitech G7 
Mouse Pad
None 
  hide details  
Reply
I LOVE 939
(13 items)
 
  
CPUMotherboardGraphicsRAM
Opteron 170 CCBWE 0550 UPMW ASUS A8N-SLI Deluxe EVGA 8800GT 2GB CorsairTwinX DDR500 CL3 
Hard DriveOptical DriveOSMonitor
WD250gig + WD500gig LG DVD-RAM/-R/+R/-RW x 2 Vista Ultimate Dell 20.1" Widescreen 
KeyboardPowerCaseMouse
Microsoft Cordless Hiper 580W Type-R ASUS Vento 3600 Black Logitech G7 
Mouse Pad
None 
  hide details  
Reply
post #2 of 3
This is a very useful reference: http://us2.php.net/reserved.variables (it pisses me off that they reorganized it into several pages, but nevertheless useful).

I can never honestly remember these, but you can always do this:
[code]<?php
print_r($_SERVER);
?>[/quote]To figure out what array name (key) you need. If you can't find exactly what you need, you'll have to do some string manipulation.
post #3 of 3
Thread Starter 
I figured it out, you have to concatinate a few varialbles together to get the full string.

Code:

<?php


echo $_SERVER["SERVER_NAME"] . $_SERVER["QUERY_STRING"];

?>
I LOVE 939
(13 items)
 
  
CPUMotherboardGraphicsRAM
Opteron 170 CCBWE 0550 UPMW ASUS A8N-SLI Deluxe EVGA 8800GT 2GB CorsairTwinX DDR500 CL3 
Hard DriveOptical DriveOSMonitor
WD250gig + WD500gig LG DVD-RAM/-R/+R/-RW x 2 Vista Ultimate Dell 20.1" Widescreen 
KeyboardPowerCaseMouse
Microsoft Cordless Hiper 580W Type-R ASUS Vento 3600 Black Logitech G7 
Mouse Pad
None 
  hide details  
Reply
I LOVE 939
(13 items)
 
  
CPUMotherboardGraphicsRAM
Opteron 170 CCBWE 0550 UPMW ASUS A8N-SLI Deluxe EVGA 8800GT 2GB CorsairTwinX DDR500 CL3 
Hard DriveOptical DriveOSMonitor
WD250gig + WD500gig LG DVD-RAM/-R/+R/-RW x 2 Vista Ultimate Dell 20.1" Widescreen 
KeyboardPowerCaseMouse
Microsoft Cordless Hiper 580W Type-R ASUS Vento 3600 Black Logitech G7 
Mouse Pad
None 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › [PHP] Displaying the full Address Bar value in Webpage