i need help with my php blog?

jono_jennings

New member
I have made a blog in PHP using mysql and phpmyadmin. i have a login.php, a admin.php and an index.php. the index.php displays the posts that in admin.php, you can create. is their a way to delete a post that i have created? login.php is feeded by PHPmyAdmin, that has the usernames and passwords. Admin.php simply has a title textbox, a category textbox and a content textbox with a submit button. which is also connected to a database. it all works accordingly. But is their any way, i can get display some sort of delete post button and allow the user to scroll through the posts and click on one? PLEASE help me. here are the codes inside the files:
admin.php
<?php
mysql_connect("mysql9.000webhost.com", "a9669267_blog", "lilly22");
mysql_select_db("a9669267_blog");
?>
<html>
<head>
<title>Admin - Post a new entry</title>
</head>
<body>
<?php
if(isset($_POST['submit'])){
$title = $_POST['title'];
$category = $_POST['category'];
$content = $_POST['content'];

mysql_query("INSERT INTO blogData (title , category , content) VALUE('$title', '$category', '$content')");

}else{
?>
<form action='admin.php' method='post'>
Title: <input type='text' name='title' /><br />
Category: <input type='text' name='category' /><br />
Content: <textarea name='content'></textarea><br />
<input type='submit' name='submit' value='Post!' />
</form>
<?php
}
?>
</body>
</html>

-----
login.php

<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="post" action="checklogin.php">
<td>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#00FFFF">
<td colspan="3" bgcolor="#FFFFFF"><strong>Member Login </strong></td>
</tr>
<tr>
<td width="78" bgcolor="#CCCCCC">Username</td>
<td width="6">:</td>
<td width="294" bgcolor="#CCCCCC"><input name="myusername" type="text" id="myusername"></td>
</tr>
<tr>
<td bgcolor="#CCCCCC">Password</td>
<td>:</td>
<td bgcolor="#CCCCCC"><input name="mypassword" type="text" id="mypassword"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">*</td>
<td>*</td>
<td><input type="submit" name="Submit" value="Login"></td>
</tr>
</table>
</td>
</form>
</tr>
</table>
-----
index.php


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php
mysql_connect("mysql9.000webhost.com", "a9669267_blog", "lilly22");
mysql_select_db("a9669267_blog");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: black;
background: #03CCFF;
}

/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
}

/* ~~ Styling for your site's links must remain
 
Back
Top