Retrieve Current Page URL using PHP

<?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; } ?> <?php echo curPageURL(); ?>

Retrieving URL Query Part

<?php function urlQUERY($url) { $url_data = parse_url ($url); if (!$url_data) return FALSE; $path =”; $query =”; if  (isset( $url_data[‘path’])) $path .=  $url_data[‘path’]; if  (isset( $url_data[‘query’])) $query .=  ‘?’ .$url_data[‘query’]; echo “$path $query “; } $url=”Enter Your URL”; urlQUERY($url)); ?>

Retrieving Page Name

By using the following script you can retrieve a page name. <?php function curPageName() { return substr($_SERVER[“SCRIPT_NAME”],strrpos($_SERVER[“SCRIPT_NAME”],”/”)+1); } echo “The current page name is “.curPageName(); ?>

Get URL from a Hyperlink

Now use the =GETURL(cell) to get the URL Example: =GETURL(A1) will return the URL for the Hyperlink displayed in cell A1 Function GETURL(HyperlinkCell As Range) GETURL = HyperlinkCell.Hyperlinks(1).Address End Function

Change Hyperlinks to a Particular Text

In a Word Document when we paste some data from some source (e.g. Websites). We find that there are some hyperlinks copied into it. Sometimes we want to change the text of all these hyperlinks to a particular word. When it is needed? It is useful where we actually want to remove all these hyperlinks … Read more

SQL Basic Queries

Basically FOUR SQL commands used very often. These four commands are SELECT, INSERT, UPDATE, DELETE By using these four basic commands you can do a lot of queries. SELECT select * from tablename INSERT insert into tablename SET col1=”, col2=” UPDATE update tablename SET col1=”, col2=” WHERE col3=” DELETE delete from tablename WHERE col1=”