Skip to content

Instantly share code, notes, and snippets.

@shahariaazam
Created September 10, 2013 22:01
Show Gist options
  • Save shahariaazam/6516364 to your computer and use it in GitHub Desktop.
Save shahariaazam/6516364 to your computer and use it in GitHub Desktop.
<?php
//echo "<a href=""http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['HTTP_HOST'] . $curdir . "index.php"">Go To Your Blog</a>" . "<br>";
/* Try to avoid mixing up your PHP and HTML .
* always try to make CLEAN code
*/
if($_SERVER['SERVER_PORT']==443)){
$url = "https://".$_SERVER['HTTP_HOST'].$curdir."index.php";
}else{
$url = "https://".$_SERVER['HTTP_HOST'].$curdir."index.php";
}
?>
<a href ='$url'>Go to your blog</a><br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment