html - Button redirects to wrong page if clicked [PHP] -
i'm writing script write data html form database. want edit entry, it's possible search , clicking image should possible edit entry.
function writeall($data, $pk) { echo '<tr>'; foreach($data $key => $value) { if(strcasecmp($key, "plz") == 0) { $key = "plz"; } else if(strcasecmp($key, "tel_handy") == 0) { $key = "mobiltelefon"; } else if(strcasecmp($key, "tel_festnetz") == 0) { $key = "festnetztelefon"; } echo ' <td>'. $value.' </td> '; } echo '<td><a href="edit.php?id='.$pk.'"><input type="image" src="button_edit.png" /></a></td></tr>'; }
that's line of code creates button beside each entry, entry id connected it.
but if click button/image, page
localhost/php/index.html?x=20&y=101
(index.html form page.) if more code needed, let me know.
why page ?
edit: added whole loop code.
change :
echo '<td><a href="edit.php?id='.$pk.'"><input type="image" src="button_edit.png" /></a></td></tr>';
to :
echo '<td><a href="edit.php?id='.$pk.'"><img src="button_edit.png" /></a></td></tr>';
Comments
Post a Comment