Skip to content

Instantly share code, notes, and snippets.

@dustinlakin
Created August 24, 2011 03:29
Show Gist options
  • Save dustinlakin/1167249 to your computer and use it in GitHub Desktop.
Save dustinlakin/1167249 to your computer and use it in GitHub Desktop.
Quick Example of dynamic page
<?php
$pageName = $_GET['page'];
switch ($pageName) {
case "javascript":
$images = array("img1.png","img2.png","img3.png");
$heading = "Javascript";
$copy = "This is my javascript work";
break;
case "php":
$images = array("img4.png","img5.png");
$heading = "PHP";
$copy = "My backend work";
break;
default:
break;
}
?>
<html>
<head>
<title>Portfolio - <?=$heading?></title>
</head>
<body>
<h1><?=$heading?></h1>
<p><?=$copy?></p>
<?
foreach ($images as $img){?>
<img src="images/<?=$img?>"/>
<?}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment