Thanks very much. Those were very helpful replies and I got a lot closer: on my test pages the code writes out correctly, but I am confused about how to make $cUserNewsContent & $cNewsContent into global variables so I can call when needed.
Thanks again
Stephen
code below (lots shorter!)
Code:
$postback = $_POST["postback"];
if ($postback=="yes") { // new input so insert
$cNewsHeadline = $_POST["headline"];
$cNewsNews = $_POST["news"];
(num,'".$cNewsHeadline."','".$cNewsNews."')";
echo "1";
}
$NewsResult=$db->query_read("SELECT * FROM " . TABLE_PREFIX . "cNews ORDER BY num DESC LIMIT 1");
$row = mysql_fetch_assoc($NewsResult);
}
$cNewsContent= "<form action='indexTest.php' method='post'><input type='text' name='cNewsHeadline' value='".$row['headline']."'><BR>";
$cNewsContent=$cNewsContent."<INPUT TYPE='text' NAME='cNewsNews' value='".$row['news']."'><BR><input type='hidden' name='postback' value='yes'>";
$cNewsContent=$cNewsContent."<INPUT TYPE='submit'></form>";
$cUserNewsContent= "<table><tr><td>".$row['headline']."</td></tr>";
$cUserNewsContent=$cNewsContent."<tr><td>"..$row['news']."</td></tr></table>";