Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

PHP

Name: Anonymous 2010-06-01 2:49

I had no idea I had a course in PHP this semester, evidently I do and the exam is tomorrow. I need to learn PHP in 18 hours and complete an assignment before the test. Teach me PHP!

Name: Anonymous 2010-06-01 6:11

>>8
Actually, having a little problem with it. So basically this is how I'm setting up my templates:

<html lang="en">
<head>
<title>[name] - Book Store</title>
<link rel="stylesheet" href="css/styl.css" type="text/css"/>
[head]
</head>
<body>
<div id="sidebar">
  <h1><a href="index.php">Book Store</a></h1>
  <p> A place to buy books </p>
  <ul id="nav">
    [navi]
  </ul>
</div>
<div id="content">
    [body]
</div>
<div id="footer"> Designed by G.J. Sussman.<br /> Copyright Book Store 2010. </div>
</body>
</html>

<?php
function make_page($name, $head, $body, $tmpl = "base_page.html", $navi = "base_navi.dat") {
        $page = $tmpl;
        $page = ereg_replace("[navi]", $navi, $page);
        $page = ereg_replace("[head]", $head, $page);
        $page = ereg_replace("[name]", $name, $page);
        $page = ereg_replace("[body]", $body, $page);
        print($page);
}
?>


Will this work? I don't have a PHP environment set up, suggest me one?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List