I'm trying to update two bits of data. The first is the name and the second is the body. Now the body is working perfectly fine on updating but the name is not and when it updates... it makes the info for the database a blank which I'm guessing means its not going through. Here is what it looks like...
<html>
<head>
<?php
include("inc/setup.inc.php");
include("inc/connect.inc.php");
include("inc/css.inc.php");
include("header.inc.php");
if ($_REQUEST['id'])
{
$postid = $_GET[id];
$posts_info = mysql_fetch_array(mysql_query("select * from evoBoard_posts where posts_id = '$postid'"));
echo "
<table cellpadding='3' cellspacing='3' border='0' align='center'>
<tr><td>Created by:</td><td> $posts_info[posts_starter]</td></tr>
<tr><td>Post Name</td><td><input type='text' name='name' value='$posts_info[posts_name]'></td></tr>
<tr><td valign='middle'>Message Body</td><td>
<form action='editpost.php?id=$_GET[id]' method='post'>
<textarea rows='15' cols='50' name='body'>$posts_info[posts_body]</textarea><br>
<input type='Submit' name='update'></td></tr>";
if($_POST[update])
{
$name = $_POST['name'];
$body = $_POST['body'];
echo "$name";
if(!$body)
{
echo "This message's body was left blank.. <a href='javascript:history.back();'>Back...</a>";
}
else
{
$query = "update evoBoard_posts set posts_name='$name', posts_body='$body' where posts_id = '$_GET[id]'";
mysql_query($query);
echo "Message edited sucessfully... <meta http-equiv='refresh' content='1; url=index.php'>";
}
}
}
?>