Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 PHP Code: Get Current Page URL Jump to:  
Category: >> PHP Code >> Get Current Page URL Bookmark and Share

<< lastnext >>

Snippet Name: Get Current Page URL

Description: This will return the URL of the current page or script. Works with HTTP and HTTPS, as well as irregular port numbers (i.e. other than port 80).

Also see:
» Show the current season (spring, summe...
» Read GET URL Variables Into An Associa...
» Saving Remote Images With PHP
» Include All Files In A Directory
» More File Type Detection in PHP
» Fix missing $_SERVER SCRIPT_URL variab...
» Get Current Page URL
» Get Current Directory Name
» Measure script run time
» USERS: view currently connected users
» Database Links: CURRENT_USER
» TIMESTAMP: Get current timestamp
» Date functions: CURRENT_DATE
» Date functions: Current Date
» Show info on current context
» url_decode that respects utf8 characte...
» Extract and Display all links on a web...
» Easy page browser
» Create an HTML page on demand
» Write to File example
» Show current time as PNG-image
» Check if a file exists
» Page creation time #2
» Page creation time
» Find the current URL of the page
» Export table to Excel or MS Word file
» Heavy Duty URL validator
» Split URL into parts #1
» Preview URL/Page On Hover
» Trippy Page

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 16th, 2009

<?PHP
 
FUNCTION curPageURL() {
 
 $pageURL = 'http';
 IF ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 
 $pageURL .= "://";
 
 IF ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 
 } ELSE {
 
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 
 RETURN $pageURL;
 
}
 
?>


Free
Oracle Magazine
Subscriptions
and Oracle White Papers


SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 261 users online    © 2009 psoug.org

PSOUG LOGIN
Username: 
Password: 
Forgot your password?