WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
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 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
פרייסז - השוואת מחירים בסופר
ZeroLag.com
Texas Holdem Poker Evangelists

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 : 2 of 5 (graded 7 times)
Viewed : 44833
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  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



PHPRecommend v1.0 - Recommend this page to a friend script written in PHP. Easy to install
Categories : PHP, URLs, Complete Programs, Email, Site Planning
Creating a Language File
Categories : PHP, Beginner Guides, Filesystem
session out Timer
Categories : PHP, Sessions, Security, Beginner Guides
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
Gonx URLs - This class is meant to generate URLs for accessing application dynamically generated pages based on parameters passed in the URL.
Categories : PHP, PHP Classes, Navigation, URLs
PHPLinkRot v1.0 - program which allows users to report broken links on your website just by clicking a button. Works well on custom 404 pages
Categories : PHP, Complete Programs, Debugging, URLs, Site Planning
Link Submition - Allow your visitors to submit links to the site.
Categories : PHP, Arrays, Filesystem, Beginner Guides
PHP function which gets all the data from a webpage into a string, we can perform regular expression functions on that data afterwards to get our desired data.
Categories : PHP, URLs, HTML and PHP
URL validator and reformatter
Categories : PHP, URLs
Making a simple Hit-Log using PHP and MySql
Categories : PHP, Log Files, Beginner Guides, Databases, MySQL
Real simple example of removing HTML tags from text then changing \n (new line) to <br>. Could be used in a forum for instance.
Categories : HTML, PHP, HTML and PHP, Beginner Guides
Newbie Notes #10 - Generating drop downs
Categories : PHP, MySQL, HTML, Beginner Guides, Databases
Remove URL Parameter Substr Strstr
Categories : PHP, URLs, Strings
Proper way to do a header redirection with PHP.
Categories : PHP, Headers, URLs
Temperature Conversion
Categories : PHP, Math., Beginner Guides