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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -