Bookmark Current Page :: PHP Tutorial
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>
discuss this topic to forum