WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Get the self URL of current page
Categories : PHP, URLs, Beginner Guides Click here to Update Your Picture
Hasin Hayder
Date : Jan 17th 2006
Grade : 3 of 5 (graded 3 times)
Viewed : 12175
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Hasin Hayder
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

<?php
function selfURL() {
   
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
   
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
   
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return
$protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function
strleft($s1, $s2) {
    return
substr($s1, 0, strpos($s1, $s2));
}
?>


so you can use it by invoking selfURL() function



Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Introduction to Language Files
Categories : PHP, Filesystem, Beginner Guides
email new items in db
Categories : PHP, Email, Databases, MySQL, Beginner Guides
php jump urls...the best way
Categories : PHP, URLs, Filesystem
Newbie Notes #8 - A cron trick
Categories : PHP, CURL, Beginner Guides
A beginner's session handling class
Categories : PHP, PHP Classes, Sessions, Beginner Guides
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
PHP Email image generator - hide your email from bots - using the GD Library
Categories : PHP, Graphics, GD image library, Beginner Guides
Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP, Form Processing, PHP Classes, Data Validation, Beginner Guides
Easy alert box pop-up function
Categories : PHP, Java Script, Beginner Guides
How to update selected fields only
Categories : PHP, Databases, Beginner Guides
Beginners Array Functions
Categories : PHP, Beginner Guides, Arrays
Newbie Notes #7 - Ridiculous regex
Categories : PHP, Beginner Guides, Regexps
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides