fert Posted December 12, 2006 Share Posted December 12, 2006 I have this code:[code]elseif($_GET['action']=="settings"){ if($_POST['style']=="") { if($_SESSION['user']=="") { die(""); } $result=@mysql_query("SELECT * FROM `blog_settings`",$cn) or die(mysql_error()); while($row=mysql_fetch_array($result)) { $style=$row['style']; $title=$row['title']; $rss=$row['rss_posts']; } echo "<form method=\"post\" action=\"blog.php?action=settings\">"; echo "<p><input type=\"text\" name=\"atom\" value=\"{$rss}\">Post to make before Atom feed is updated</p>"; echo "<p><input type=\"text\" name=\"title\" value=\"{$title}\">Blog title</p>"; echo "<p><textarea name=\"style\" rows=\"10\" cols=\"30\">{$style}</textarea></p>"; echo "<p><input type=\"submit\" value=\"Save\"></p></form>"; } else { $title=$_POST['title']; $style=$_POST['style']; @mysql_query("UPDATE `blog_settings` SET `title`='$title', `style`='$style' WHERE 1",$cn) or die(mysql_error()); Redirect(0,"blog.php"); }}[/code]This code is a part of a much large blog code. This code is suppose to take you to the blog settings, but when i try to get to that page it just redirects me back to the home page. Any ideas as to why it does this? Quote Link to comment Share on other sites More sharing options...
BillyBoB Posted December 12, 2006 Share Posted December 12, 2006 well without looking at the rest of the coding i would have to guess that the style in the form has been posted so its following the rest of the code [code]Redirect(0,"blog.php");[/code]without seeing the rest i cant really help but i hope this helps Quote Link to comment Share on other sites More sharing options...
fert Posted December 12, 2006 Author Share Posted December 12, 2006 it's not that part because the first variable passed is the time till redirect, but if i change it there is no difference. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.