Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <?php include('configuration.php'); ?>
- <title>Dispol</title>
- <meta name="description" content="website description" />
- <meta name="keywords" content="website keywords, website keywords" />
- <meta http-equiv="content-type" content="text/html; charset=windows-1252" />
- <link rel="stylesheet" type="text/css" href="style/style.css" title="style" />
- </head>
- <body>
- <div id="main">
- <div id="header">
- <div id="logo">
- <div id="logo_text">
- <!-- class="logo_colour", allows you to change the colour of the text -->
- <h1><a href="index.html">Dispol<span class="logo_colour">returned.</span></a></h1>
- <h2>An Austen Patterson Project</h2>
- </div>
- </div>
- <div id="menubar">
- <ul id="menu">
- <?php include('nav.php'); ?>
- </ul>
- </div>
- </div>
- <div id="site_content">
- <div class="sidebar">
- <!-- insert your sidebar items here -->
- <h3>Latest News</h3>
- <h4>Stay tuned!</h4>
- <h5>July 4th, 2011</h5>
- <p>Dispol is returning.</p>
- <p></p>
- </div>
- <div id="content">
- <?php
- if($_GET['page'] == ""){
- ?>
- <?php
- mysql_connect($mysql_host, $mysql_user, $mysql_password) or die(mysql_error());
- mysql_select_db($mysql_database) or die(mysql_error());
- $result = mysql_query("SELECT * FROM content
- WHERE page='index'") or die(mysql_error());
- $row = mysql_fetch_array( $result );
- ?>
- <h1><?php echo $row['title']; ?></h1>
- <p><?php echo $row['content']; ?></p>
- <?php
- }
- if($_GET['page'] == "contact"){
- ?>
- <h1>Contact Us</h1>
- <p>ERMMMMMMMMM</p>
- <?php
- }
- if($_GET['page'] == "adminseen"){
- ?>
- Welcome to the administratorcus section.. :)
- Update content below :) <br />
- <form action='?page=postcontent' method='post' >
- Page: (index for default) <input type='text' name='page' length='15' /><br />
- Title: <input type='text' name='page' length='15' /><br />
- Body: <textarea name='content' length='300' width='100' /></textarea>
- <input type='submit' value='Post that shit'>
- </form>
- <?php
- }
- if($_GET['page'] == "postcontent"){
- mysql_connect($mysql_host, $mysql_user, $mysql_password) or die(mysql_error());
- mysql_select_db($mysql_database) or die(mysql_error());
- $result = mysql_query("SELECT * FROM content
- WHERE page='index'") or die(mysql_error());
- $row = mysql_fetch_array( $result );
- $page = $_POST['page'];
- $title = $_POST['title'];
- $content = $_POST['content'];
- // Some debug stuff. Will return a value for each variable - if any(or all) are missing, this is what will be causing the update query failure.
- print_r($page);
- print_r($title);
- print_r($content);
- die();
- // Commented out for debugging
- //$result = mysql_query("UPDATE content SET content='$content' WHERE page='$page'")
- //or die(mysql_error());
- }
- ?>
- </div>
- </div>
- <div id="content_footer"></div>
- <div id="footer">
- © 2011 Austen Patterson
- </div>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement