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
Internet Security Software
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
פרייסז - הכח לקנות עובר לידיים שלך
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 : 41947
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



IPhider Obscure Any URL Anonymity connection lores obfuscation corporate survival.
Categories : PHP, Algorithms, Security, URLs
Proper way to do a header redirection with PHP.
Categories : PHP, Headers, URLs
phpRecommend v1.2 - UPDATED - recommend this page to a friend script - VERY easy install - now with data logging to text file
Categories : Complete Programs, PHP, Link to Article, URLs, Misc
How to display any array in several rows and columns of a table. Not just in one column or in alternate rows. This example shows a nice color table generated with PHP, but can be used with any array values(e.g. Database)
Categories : Arrays, PHP, Miscellaneous, Beginner Guides, Graphics
Newbie Notes #3 - What went wrong? A useful little debugging aid
Categories : PHP, Beginner Guides, Debugging
Db_lib - practical example usage of database abstraction and form validation.
Categories : PHP, Form Processing, PHP Classes, Data Validation, Beginner Guides
A very simple PHP single password cookie based login without usernames.
Categories : PHP, Cookies, Security, Beginner Guides
Form Submission Using Array's
Categories : PHP, HTML and PHP, Beginner Guides, Arrays
Simple SOAP Example (with SoapClient)
Categories : PHP, Web Services, SOAP, Beginner Guides
SQLite PHP Database Wrapper
Categories : PHP, PHP Classes, Databases, SQLite, Beginner Guides
PHP Utilities - correct grammar helpers: the plural, to be and to have
Categories : PHP, Utilities, Beginner Guides
Script loading time
Categories : PHP, Beginner Guides, Date Time
PHP Email image generator - hide your email from bots - using the GD Library
Categories : PHP, Graphics, GD image library, Beginner Guides
SubmitForce URL power submitter (searchengine submission class)
Categories : PHP, Search Engines, URLs, PHP Classes
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides