Jump to content

GET form errror


Guest

Recommended Posts

Hello,

 

I have an error with 1 part of code,

$query = mysql_query ("SELECT * FROM news ORDER BY id DESC");
while($row = mysql_fetch_array($query))
{
echo "<form action=update2.php method=get>";
echo "<tr>";
echo '<td><input type="hidden" name="id" value=' .	$row["id"] . '> </td>';
echo "<div align='left'><table><td><input type='submit' name='update' value='update'" . " </td> </table>";
echo "</form>";
echo "<form action=news2.php method=post>";
echo "<td><input type='hidden' name='hidden' value='" .	$row['headline'] . "'> </td>";
echo "<div align='center'><table><td><input type='submit' name='delete' value='delete'" . " </td> </table>";
echo "</form>";
echo "</tr>";
}

in this part

echo '<td><input type="hidden" name="id" value=' .	$row["id"] . '> </td>';

the page update2.php gets not only the id.

It looks like

http://localhost/project1/News/update2.php?id=411%3E+%3C%2Ftd%3E%3Cdiv+align%3D&update=update 

and it should be only 

http://localhost/project1/News/update2.php?id=411 . 

Sorry for my bad English.

Link to comment
https://forums.phpfreaks.com/topic/280493-get-form-errror/
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.