Jump to content

Edit News Help


Guteman

Recommended Posts

I am making my own news script, but I seem to be stuck with this code trying to edit the news Im not getting Information updated echo.

here is the code.

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
<form action=admin-news.php method="post">
<input type="hidden" name="cmd" value="edit">

<table width=325 cellspacing=0 cellpadding=0 border=0 align=center>
<tr><td>Title:</td><td><input type="text" name="title" value="<?php echo $myrow["title"] ?>" size=30></td></tr>
<tr><td>Story:</td><td><textarea name="story" rows=5 cols=20><?php echo $myrow["story"] ?></textarea></td></tr>
<tr><td>Author:</td><td><input type="text" name="author" value="<?php echo $myrow["author"] ?>" size=30></td></tr>
<input type="hidden" name="cmd" value="edit">
<tr><td colspan=2 align=center><br><input type="submit" name="submit" value="Submit"></td></tr>
</table>
</form>

<?php


}

if ($_POST["$submit"])

{
$id = $_GET["id"];
$title = $_POST["title"];
$story = $_POST["story"];
$author = $_POST["author"];

mysql_query("UPDATE news SET title='$title' , story='$story' , author='$author' WHERE ID='$id'");

echo ("Thank you! Information updated.");

}
}
?> [/quote]
Link to comment
https://forums.phpfreaks.com/topic/10470-edit-news-help/
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.