Created
August 24, 2011 03:29
-
-
Save dustinlakin/1167249 to your computer and use it in GitHub Desktop.
Quick Example of dynamic page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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