Jump to content

Code won't display form


fert

Recommended Posts

I have this code:
[code]
else
if($_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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.