I broke this out from my index.php that used to be within a function and made a separate question.php
Here is what I have.
//Save Question
if ($op == "SaveQuestion") {
$title = $_POST['title'];
if (isset($_POST['title']) && !empty($_POST['title'])) {
echo"Question has been saved";
}else {
echo "<h1>Uh Oh! I think you have a problem!</h1>";
}
$sql = $db->sql_query("SELECT * FROM comment_queue WHERE cid = '$cid'");
while ($row = $db->sql_fetchrow($sql)) {
$title = stripslashes(check_html($row['title'], 'nohtml'));
$comment_text = stripslashes(check_html($row['comment_text'], 'nohtml'));
}
OpenTable();
echo "<form method=\"POST\" action=\"" .$_SERVER['PHP_SELF'] ."\">\n";
echo "<b>Title:</b><br />"
."<input type=\"text\" name=\"title\" size=\"50\" maxlength=\"80\" value=\"$title\" /><br />"
. "<b>Text:</b>You can use HTML to format your question.<br />"
."<textarea cols=\"50\" rows=\"15\" style=\"background:#EFEFEF\" name=\"comment_text\">$comment_text</textarea><br />";
echo "<p>If you included any URLs or html, be sure to double check them for typos.</p>"
."<p>Allowed HTML:<br />"
."</p>"
."<p>";
while (list($key,) = each($AllowableHTML)) echo ' <'.$key.'>';
echo "</p>";
echo"<br>";
echo"<a href=\"question.php?op=DeleteQuestion&cid=$cid\">Delete</a>";
echo"<br>";
echo"<a href=\"question.php?op=PreviewQuestion&cid=$cid\">Preview</a>";
echo"<br>";
echo"<a href=\"question.php?op=SaveQuestion&cid=$cid\">Save</a>";
echo"<br>";
echo "<input name=\"cid\" type=\"hidden\" value=\"$cid\" />";
echo "</form>";
CloseTable();
It is a simple enough form that I have had many problems with.
I could not read anything out of the $_POST array
As you can imagine all I get back is --
Uh Oh! I think you have a problem!
Envirnoment is a MAC OSX server running PHP Version 4.4.4 with registered_globals off