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? Link to comment https://forums.phpfreaks.com/topic/30296-code-wont-display-form/ 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 Link to comment https://forums.phpfreaks.com/topic/30296-code-wont-display-form/#findComment-139413 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. Link to comment https://forums.phpfreaks.com/topic/30296-code-wont-display-form/#findComment-139417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.