<div class="modal-dialog" style="width:70%;"> <div class="row"> <div class="col-sm-12"> <?php include 'mysql.php'; $result = mysql_safe_query('SELECT * FROM posts WHERE id=%s LIMIT 1', $_GET['id']); if (!mysql_num_rows($result)) { echo 'Post #' . $_GET['id'] . ' not found'; exit; } $row = mysql_fetch_assoc($result); echo '<h2>' . $row['title'] . '</h2>'; echo '<em>Posted ' . date('F j<\\s\\up>S</\\s\\up>, Y', $row['date']) . '</em><br/>'; echo nl2br($row['content']) . '<br/>'; echo '<hr/>'; $result = mysql_safe_query('SELECT * FROM comments WHERE post_id=%s ORDER BY date ASC', $_GET['id']); echo '<ol id="comments">'; while ($row = mysql_fetch_assoc($result)) { echo '<li id="post-' . $row['id'] . '">'; echo empty($row['website']) ? '<strong>' . $row['name'] . '</strong>' : '<a href="' . $row['website'] . '" target="_blank">' . $row['name'] . '</a>'; echo '<br/>'; echo '<small>' . date('j-M-Y g:ia', $row['date']) . '</small><br/>'; echo nl2br($row['content']); echo '</li>'; } ?> </div> <?php echo '</ol>'; ?> <?php
<?php include 'mysql.php'; if (!empty($_POST)) { if (mysql_safe_query('UPDATE posts SET title=%s, body=%s, date=%s WHERE id=%s', $_POST['title'], $_POST['body'], time(), $_GET['id'])) { redirect('post_view.php?id=' . $_GET['id']); } else { echo mysql_error(); } } $result = mysql_safe_query('SELECT * FROM posts WHERE id=%s', $_GET['id']); if (!mysql_num_rows($result)) { echo 'Post #' . $_GET['id'] . ' not found'; exit; } $row = mysql_fetch_assoc($result); echo <<<HTML <form method="post"> \t<table> \t\t<tr> \t\t\t<td><label for="title">Title</label></td> \t\t\t<td><input name="title" id="title" value="{$row['title']}" /></td> \t\t</tr> \t\t<tr> \t\t\t<td><label for="body">Body</label></td> \t\t\t<td><textarea name="body" id="body">{$row['body']}</textarea></td> \t\t</tr> \t\t<tr> \t\t\t<td></td> \t\t\t<td><input type="submit" value="Save"/></td> \t\t</tr>
<ul class="dropdown-menu"> <li><a href="logout.php">Log Out</a></li> </ul> </li> </ul> </div> </div> </nav> <div class="modal-dialog" style="width:55%;"> <div class="row"> <div class="col-sm-12"> <?php include 'mysql.php'; $result = mysql_safe_query("SELECT * FROM posts WHERE username='******' ORDER BY date DESC"); if (!mysql_num_rows($result)) { echo 'No posts yet.'; } else { while ($row = mysql_fetch_assoc($result)) { echo '<h2>' . $row['title'] . '</h2>'; $content = substr($row['content'], 0, 300); echo nl2br($content) . '...<br/>'; ?> <br><p class="lead"><button class="btn btn-default"><?php echo '<a href="post_view1.php?id=' . $row['id'] . '">Read More</a>'; ?> </button></p> <ul class="list-inline"><li><?php php; ?>
<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="logout.php">Log Out</a></li> </ul> </li> </ul> </div> </div> </nav> <div class="modal-dialog" style="width:55%;"> <div class="row"> <div class="col-sm-12"> <?php include 'mysql.php'; $result = mysql_safe_query('SELECT * FROM messaging1 ORDER BY date DESC'); if (!mysql_num_rows($result)) { echo 'No posts yet.'; } else { while ($row = mysql_fetch_assoc($result)) { echo '<h2>' . $row['name1'] . '</h2>'; $message1 = substr($row['subject1'], 0); echo nl2br($message1) . '...<br/>'; ?> <br><p class="lead"><button class="btn btn-default"><?php echo '<a href="message_view_admin.php?id=' . $row['id'] . '">Read More</a>'; ?> </button> <button class="btn btn-default"><?php echo '<a href="delete_messege_admin.php?id=' . $row['id'] . '">Delete</a>'; ?> </button></p>
<?php include 'session.php'; $error = ""; if (!empty($_POST)) { include 'mysql.php'; if (mysql_safe_query('INSERT INTO posts(title,content,date,username) values(%s,%s,%s,%s)', $_POST['title'], $_POST['post'], time(), $login_session)) { echo 'Entry posted.'; } else { $error = "Please try again"; } } ?> <!DOCTYPE html> <html> <head> <title>Blogger || Login</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <body> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="Home_admin.php">Blogger</a> </div> <div> <ul class="nav navbar-nav">
<?php include 'mysql.php'; $expire = time() + 60 * 60 * 24 * 30; setcookie('name', $_POST['name'], $expire, '/'); setcookie('email', $_POST['email'], $expire, '/'); setcookie('website', $_POST['website'], $expire, '/'); mysql_safe_query('INSERT INTO comments (post_id,name,email,website,content,date) VALUES (%s,%s,%s,%s,%s,%s)', $_GET['id'], $_POST['name'], $_POST['email'], $_POST['website'], $_POST['content'], time()); mysql_safe_query('UPDATE posts SET num_comments=num_comments+1 WHERE id=%s LIMIT 1', $_GET['id']); redirect('post_view.php?id=' . $_GET['id'] . '#post-' . mysql_insert_id());
<div> <ul class="nav navbar-nav navbar-right"> <li><a href="admin.php"><span class="glyphicon glyphicon-wrench"></span> Admin</a></li> <li><a href="signup.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li> <li><a href="login.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li> </ul> </div> </div> </nav> <div class="modal-dialog" style="width:55%;"> <div class="row"> <div class="col-sm-12"> <?php include 'mysql.php'; $result = mysql_safe_query('SELECT * FROM posts ORDER BY date DESC'); if (!mysql_num_rows($result)) { echo 'No posts yet.'; } else { while ($row = mysql_fetch_assoc($result)) { echo '<h2>' . $row['title'] . '</h2>'; $content = substr($row['content'], 0, 300); echo nl2br($content) . '...<br/>'; ?> <br><p class="lead"><button class="btn btn-default"><?php echo '<a href="post_view2.php?id=' . $row['id'] . '">Read More</a>'; ?> </button></p> <ul class="list-inline"><li><?php php; ?>
<?php if (!empty($_POST)) { include 'mysql.php'; if (mysql_safe_query('INSERT INTO posts (title,body,date) VALUES (%s,%s,%s)', $_POST['title'], $_POST['body'], time())) { echo 'Entry posted. <a href="post_view.php?id=' . mysql_insert_id() . '">View</a>'; } else { echo mysql_error(); } } ?> <form method="post"> <table> <tr> <td><label for="title">Title</label></td> <td><input name="title" id="title" /></td> </tr> <tr> <td><label for="body">Body</label></td> <td><textarea name="body" id="body"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" value="Post" /></td> </tr> </table> </form>
<?php include 'mysql.php'; mysql_safe_query('DELETE FROM messaging1 WHERE id=%s LIMIT 1', $_GET['id']); redirect('message_admin.php');
<?php include 'mysql.php'; mysql_safe_query('DELETE FROM posts WHERE id=%s LIMIT 1', $_GET['id']); mysql_safe_query('DELETE FROM comments WHERE post_id=%s', $_GET['id']); redirect('Home1.php');
?> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="logout.php">Log Out</a></li> </ul> </li> </ul> </div> </div> </nav> <div class="modal-dialog" style="width:70%;"> <div class="row"> <div class="col-sm-12"> <?php include 'mysql.php'; $result = mysql_safe_query('SELECT * FROM messaging1 WHERE id=%s LIMIT 1', $_GET['id']); if (!mysql_num_rows($result)) { echo 'Post #' . $_GET['id'] . ' not found'; exit; } $row = mysql_fetch_assoc($result); echo '<h2>' . $row['subject1'] . '</h2>'; echo '<em>Message on ' . date('F j<\\s\\up>S</\\s\\up>, Y', $row['date']) . '</em><br/>'; echo nl2br($row['message1']) . '<br/>'; echo '<a href="delete_messege_admin.php?id=' . $_GET['id'] . '">Delete</a>'; echo '<hr/>'; ?> </div> <?php echo '</ol>'; ?>
<?php $error = ""; if (!empty($_POST)) { include 'mysql.php'; if (mysql_safe_query('INSERT INTO messaging1(name1,email1,subject1,message1,date) values(%s,%s,%s,%s,%s)', $_POST['name1'], $_POST['email1'], $_POST['subject1'], $_POST['message1'], time())) { echo 'Entry posted.'; } else { $error = "Please try again"; } } ?> <!DOCTYPE html> <html> <head> <title>Blogger || Contact Us</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </head> <body> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="index.php">Blogger</a> </div> <div> <ul class="nav navbar-nav"> <li><a href="index.php">Home</a></li>