BLiu1's Blog

How It Works: Blog v1.1

December 3, 2013

I'm busy, but here is the source to my blog.

	if (isset($_GET["page"]) && is_numeric($_GET["page"])){
		$page = $_GET["page"];
	} else {
		$page = "0";
		case "0": $title = "Index"; break;
		case "1": $title = "First Post"; break;
		case "2": $title = "How It Works: Blog v1.1"; break;
		case "3": $title = "Escape From Isolation 2.1"; break;
		case "4": $title = "Server Side & Client Side Includes"; break;
		case "5": $title = "All Pages PHP"; break;
		default:  $title = "Index";

<!DOCTYPE html>
	<title>BLiu1's Blog - <?php echo($title); ?></title>
	<meta name="description" content="My Weblog" />
	<meta name="keywords" content="BLiu1, blog" />
	<meta name="viewport" content="user-scalable = yes, initial-scale = 1" />
	<meta charset="utf-8" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="stylesheet" type="text/css" href="/blog/blog.css" />
	<header class="container">
		<h1>BLiu1's Blog</h1>
	<div id="to_top"><a href="#">^</a></div>

	if ($title == "Index"){
		<p>Blog Posts:</p>
		<ul id="post_list">
			<li><a href="/blog/index.php?page=5">All Pages PHP</a></li>
			<li><a href="/blog/index.php?page=4">Server Side & Client Side Includes</a></li>
			<li><a href="/blog/index.php?page=3">Escape From Isolation 2.1</a></li>
			<li><a href="/blog/index.php?page=2">How It Works: Blog v1.1</a></li>
			<li><a href="/blog/index.php?page=1">First Post</a></li>
		<p>This is a very plain and infrequently updated blog.</p>
	<div id="backlink" class="container"><a href="/">Back</a></div>

<?php } else {
echo '	<div id="backlink" class="container"><a href="/blog/index.php">Back</a></div> ';

<!-- Tracker -->
<div id="eXdiv">
<div id="eXTReMe"><a href="">
<img src="" style="border: 0;"
height="38" width="41" id="EXim" alt="eXTReMe Tracker" /></a>
<script type="text/javascript"><!--
</script><script type="text/javascript"><!--
var EXlogin='bliu1' // Login
var EXvsrv='s9' // VServer
EXd.write("<img "+EXsrc+"=",
"l="+escape(EXref)+" height=1 width=1>");//-->
</script><noscript><div id="neXTReMe"><img height="1" width="1" alt=""
src="" />

	<script src="/blog/prism.js"></script>
	<script src="/blog/masonry.pkgd.min.js"></script>
	/*To_top script*/var t=document.getElementById('to_top');setInterval(function(){var s=(window.pageYOffset!==undefined)?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;if(s<300){t.className='up'}else{t.className=''};},100)
	/*Masonry Initialization*/
	var container = document.getElementById('post_list');
	var msnry = new Masonry( container, {
		columnWidth: 1,
		gutter: 10,
		itemSelector: 'li'


It's very simple.

Using the $_GET superglobal, it assigns the title of the page and includes the numbered file with the article. If the page "number" is not a number or a nonexistent page, it displays the index/homepage.



BLiu1's Blog - How It Works: Blog v1.1

comments powered by Disqus
eXTReMe Tracker