How to Find the Current URL with PHP
The full URL to a page comes in three parts: The domain name, the path to the file then the filename, and the query string. For example, take the URL http://www.example.com/ex ample/page.php?name=Bob: 1. The domain name: www.example.com; 2. The path to the page: /example/page.php; 3. The query string: name=Bob So how do you find it all out in your own PHP scripts? This guide will tell you how access each of these elements by using the $_SERVER superglobal array which is available at all times within your PHP scripts.
- Visit Site:
- How to Find the Current URL with PHP
- Filed in:
-
PHP / Tutorials & Tips / Miscellaneous
- Platforms:
-




- Databases:
-
- Date Added:
- Nov 14, 2005
- Last Updated:
- Dec 10, 2006
License and Pricing Information
Other
Price: $0.00 USD
| Publisher site visits: | 3,377 |
|---|---|
| Average rating: | 4.25 |
| Total ratings: | 12 |
Publisher Info
- Author:
- Sven Vdhrison
Other listings by this publisher
- Find a visitor's IP Address with ASP
- Your First Java Program
- How to use the QueryString in ASP
- How to Find the Current URL with ASP
- How to write text on a dynamically generated image
- Write text on an existing PNG image in PHP
- Generate a Month Calendar in PHP
- How to use the query string in PHP
- Use PHP on pages without a .php extension
- Find a visitor's IP Address with PHP
- Image rotation with PHP
- Temperature Conversion in Java
- The Difference Between require() and include()
- Finding Items in an Array with PHP
