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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.