admin管理员组文章数量:1332377
I wanted to Change the submit button of my form.I manage to do it and Its quite easy however the code breaks. When i fixed the code. The submit button changes back to its default image and it said submit query which i did not initialize. I have not figured out how to fix it since then. Which is weird.
<?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 on to this
<?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 should have change "image" with "SUBMIT". But if I do that, then the image would be in default.
so in short
type='SUBMIT' -> i get to make the code work but default picture.
type='image' -> i get the nice image but the code wont work.
I wanted to Change the submit button of my form.I manage to do it and Its quite easy however the code breaks. When i fixed the code. The submit button changes back to its default image and it said submit query which i did not initialize. I have not figured out how to fix it since then. Which is weird.
<?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 on to this
<?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 should have change "image" with "SUBMIT". But if I do that, then the image would be in default.
so in short
type='SUBMIT' -> i get to make the code work but default picture.
type='image' -> i get the nice image but the code wont work.
Share Improve this question edited Jan 29, 2011 at 11:49 Eray 7,12816 gold badges73 silver badges124 bronze badges asked Jan 29, 2011 at 10:55 Ivan Reuben Ramos MuitIvan Reuben Ramos Muit 1714 gold badges4 silver badges13 bronze badges1 Answer
Reset to default 4You can just set the background image of the button using css.
<input type="submit" style="background-image: url(bgb.png);" />
(Better to use separate style sheet off course)
本文标签: phpChange image of Submit buttonStack Overflow
版权声明:本文标题:php - Change image of Submit button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742306316a2449987.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论