I'm having some problems with a site I recently "inherited" for lack of a better word.
I'm not sure whether they're related or not.
The first problem only occurs when a user has logged in and their session variables are populated. Only when they're logged in Posting redirects the browser back to the index! There's no reason for this that I can think of.
The data is never actually posted either and if the form involves adding data to the database, it also fails to do so.
On the other hand, if you're browsing the site and are not logged in posts complete successfully.
The second issue only seems to occur on IE6 & 7 but not in Mozilla or Opera. When you navigate to a certain page the session abruptly ends for no reason.
Here is an example of one of the forms that somehow causes the browser to go back to the index after Posting
The code is a bit sloppy, sorry for that. In fact the whole site is one huge mess as near as I can tell.
$user=$_SESSION['user'];
$uuser_id= $_SESSION['uuserid'];
echo "<table width=550 border=0 cellpadding=20 cellspacing=10>";
echo "<tr>";
echo "<form action=\"postquestion.php\" method=\"POST\">";
echo "<td width=150>";
echo "<img src=\"template/1.jpg\"> ";
echo "</td>";
echo "<td bgcolor=\"#F0F0F0\">\n";
echo "<div class=\"maintext\"><b>Topic</b></div><input type=\"text\" name=\"topic\" size=\"53\" />\n";
echo "</td>\n";
echo "</tr><tr>";
echo "<td width=150 ><img src=\"template/2.jpg\"></td>";
echo "<td bgcolor=\"#F0F0F0\"><div class=\"maintext\"><b>Question</b></div><textarea name=\"ques\" rows=\"5\" cols=\"40\"> ".$_SESSION['questions']."</textarea></td>";
echo "<tr><td >";
echo "<img src=\"template/3.jpg\"> ";
echo "</td>";
echo "<td bgcolor=\"#BFD0D1\">";
echo "<div class=\"maintext\"><b>Value</b></div><select name=\"price\" >";
for ($i=5; $i<55; $i=$i+5){ echo "<option value =\"$i\">$".$i."</option>"; }
echo "</select>";
echo "<br><div class=\"maintext\">Need an answer fast? Bid high.</div></td>";
echo "</tr>";
echo "<tr><td >";
echo "<img src=\"template/4.jpg\">";
echo "</td>";
echo "<td bgcolor=\"#F0F0F0\">";
echo "<div class=\"maintext\"><b>Category</b></div><select name=\"cat\" >";
$cat_query = "SELECT * FROM categories";
$cat_result = mysql_query($cat_query);
while($cat_row = mysql_fetch_array($cat_result))
{
echo "<option value =\"".$cat_row['id']."\">".$cat_row['catname']."</option>";
//echo ">>".$cat_row['catname'];
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td></td>";
echo "<td><input type=\"Submit\" value=\"Next\" name=\"Submit\" /></td>";
echo "</tr>";
echo "</form>";
echo "</table>";