PHP Project -7: Bookmark Current Page by PHP

Posted: November 9, 2010 in HTML, PHP
Tags: ,

In this tutorial I discuss how to Bookmark current page by PHP.below I give the code.

Code:

<?php
function get_url()
{
if($_SERVER['HTTPS'])
{
$linkurl = 'https://';
}
else
{
$linkurl = 'http://';
}

$linkurl .= $_SERVER['HTTP_HOST'];

if($show_port)
{
$my_url .= ':' . $_SERVER['SERVER_PORT'];
}

$linkurl .= $_SERVER['SCRIPT_NAME'];

if($_SERVER['QUERY_STRING'] != null)
{
$linkurl .= '?' . $_SERVER['QUERY_STRING'];
}

return $linkurl;
}

$myurl = get_url();

?>

<a href="javascript:window.external.AddFavorite('
<?php echo $myurl ?>', 'Example.com')">
<img src="http://www.example.com/images/example.gif"
border="0"></a>
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s