Jump to content

GET form errror


Guest
Go to solution Solved by 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.

Edited by AxelhacK
Link to comment
Share on other sites

  • Solution

Thanks for the fast answer.

I´ve allready solved it.

Replaced the whole form with

echo '<a href="update2.php?id='.$row['id'].'" target="_blank">edit</a>';

~close please :)

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.