Jump to content


Photo

Get Location


  • Please log in to reply
5 replies to this topic

#1 KittyKate

KittyKate
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 18 August 2006 - 05:26 PM

I want to check to see what the location is to see if I need to print certain information or not. So, how do I pull the "*.php" part of address? I can figure out how to set it, or grab it within my HTML (using DOM), but how do I grab it on the server side?
PHP Version 4.3.2
MySQL version unknown (greater or equal to 3.23)

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 18 August 2006 - 05:30 PM

$_SEREVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME'] or $_SEREVER['FILE_NAME']

check out the super globals array to see merits of each
follow me on twitter @PHPsycho

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 18 August 2006 - 05:30 PM

$_SERVER['PHP_SELF'] or $_SERVER['SCRIPT_NAME']

Hehe too slow :(

#4 Ifa

Ifa
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts
  • LocationRauma, Finland

Posted 18 August 2006 - 05:31 PM

or __FILE__  :D
I'm just a guy who likes to code for fun...

#5 KittyKate

KittyKate
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts

Posted 18 August 2006 - 05:38 PM

Thanks!
PHP Version 4.3.2
MySQL version unknown (greater or equal to 3.23)

#6 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 18 August 2006 - 10:34 PM

also check out basename() to use with PHP_SELF and such
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users