This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes PHP and the fly likes is any PHP server var that gives url of home page without the webpage.php file name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » PHP
Bookmark "is any PHP server var that gives url of home page without the webpage.php file name" Watch "is any PHP server var that gives url of home page without the webpage.php file name" New topic
Author

is any PHP server var that gives url of home page without the webpage.php file name

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
is any PHP SERVER Var that gives url of home page without the webpage.php file name?

eg. http://www.ffff.com/ggg/index.php to give "www.ffff.com/ggg/"??? this want for testing so NOT? have to change url during debugging/testing...well?
Nick Charles
Ranch Hand

Joined: Oct 09, 2011
Posts: 71

The various data provided by $_SERVER variable should enable you to construct the value you want:
http://www.php.net/manual/en/reserved.variables.server.php
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4343
    
    8

If you add a phpinfo() call to a page, one of the things it prints out is a complete list of all the $_SERVER variables that are being set and their values. You should be able to work out from there which one gives you the information you need.
Jared Drake
Greenhorn

Joined: Aug 26, 2012
Posts: 5

You are most definitely looking for PHP info. Check out http://php.net/manual/en/function.phpinfo.php for a list of all of phpinfo's constants.


I am a writer for Web Programming Tutorial and Reference
 
wood burning stoves
 
subject: is any PHP server var that gives url of home page without the webpage.php file name
 
Similar Threads
Tomcat + Apache first time
Creating file on server - java.io.FilePermission - access denied
PHP
Error Handler
Running an applet in Wicket 1.3.5