Change the image of the submit button

I would like to change the submit button on my form. I succeed, and it's pretty easy, but the code breaks. When I fixed the code. The submit button returns to its default image, and it said a send request that I did not initialize. I did not understand how to fix this since. Which is strange.

<?Php
    echo "<div style='text-align:right'>
       <form action='upd2.php' method='POST'>
       <Table border='0' align='right'>
       <tr>
        <td ><font size='-3'>ID Search</font></td>
        <td rowspan =2><input name='image' type='image' id='SUBMIT' src='images/_Images_buttons_search_button.jpg'></td>
       </tr>
       <tr>
        <td><input name='ID_NO' type='text' id='ID_NO'></td>
       </tr>
       </table><br>
       </FORM> </div>";
?>

I pass it

<?php
    print "<H2>Update User Info</H2>";

    $ID_NO   = clean($_POST['ID_NO']);
 $_SESSION["ID_NO"] = $ID_NO;
     if (isset($_POST['image'])) {
        $result = mysql_query("SELECT * FROM user_info WHERE ID_NO = '$ID_NO'");
        if(!mysql_num_rows($result)) {
            print "<BR><BR>There is no such User with a User Number of $ID_NO <BR><A HREF ='UpdateUser.php'>Go Back</A>";
     exit();
        }
        else {
            $row_array = mysql_fetch_array($result, MYSQL_ASSOC);
?>

however, it does not work (the variable wasnt able to get it). I need to change the "image" to "SUBMIT". But if I do, the image will be the default.

so shorter

type = 'SUBMIT' -> I can make the code work, but the image is by default.

type = 'image' → I get a nice image, but the code is not working.

+3
source share
1

css.

<input type="submit" style="background-image: url(bgb.png);" />

( )

+5

Source: https://habr.com/ru/post/1788669/


All Articles