View Single Post
Old 08-30-2009, 08:54 AM   #10 (permalink)
tearsofthesun
The Wanderer
 
Join Date: Aug 2009
Posts: 15
Thanks: 11
tearsofthesun is on a distinguished road
Default

Well i sort of got this script to work, alright here is the problem.

When i go to MY ADMIN PHP and manually insert some dummie data's it works. but when i go to a user's page and type in some comments, it doesn't display.

you can try it here,
http://www.starcraftx.com/results.php?id=103

anyone seem to know whats wrong??? thanks!

PHP Code:
<?php
//Connect to database
include ('connect.php');
$id $_GET['id'];
$queryget mysql_query("SELECT * FROM members WHERE id = '" $id "' ") or die (mysql_error());
$row mysql_fetch_array($queryget);
{
//get row data and store in var's
$id $row['id'];
$name $row['name'];
$message $row['message'];

//show data to user
echo"
<table><tr>

<td>"
.$message." <br> ".$setname."</td></tr></table>";
}

if (
$_POST['submit'])
{
$name $_POST['name'];
$message $_POST['message'];

if(
$name&&$message)
{
$querypost mysql_query ("INSERT INTO members VALUES ('','$name','$message')");
echo
"Please wait..... <meta http-equiv='refresh' content='1;url=results.php?id=$id'>";
}
else
echo 
"Please fill out all fields.";
}

echo 
"
<form action='results.php?id=
$id' method='POST'><table width='100%'>
<tr><td width='5%' valign='top'>Name:</td>
<td><input type='text' name='name' maxlength='25'></td></tr>

<tr><td valign='top'>Message:</td><td>
<textarea cols='20' rows='2' name='message' maxlength='250'></textarea>
<p>
<input type='submit' name='submit' value='Post'>
</td>
</tr>
</table>
</form>"
;
?>
tearsofthesun is offline  
Reply With Quote