echo "<a href=User_list.php?id=$row[1]&sec=$row[5]&subj=$row[6]&type=viewrec2&Year=$row[12]&faci=$row[9]>LIST</a></td>";
how can i convert this code into a button? and make the button as an image button that i made.
echo "<a href=User_list.php?id=$row[1]&sec=$row[5]&subj=$row[6]&type=viewrec2&Year=$row[12]&faci=$row[9]>LIST</a></td>";
how can i convert this code into a button? and make the button as an image button that i made.
Try
<input type="button" onclick="window.location = 'User_list.php?id=$row[1]&sec=$row[5]&subj=$row[6]&type=viewrec2&Year=$row[12]&faci=$row[9]'" class="myButton" />
You can use CSS to style your button's background image accordingly
To add an image to a HTML form button, try this:
<button name="somebutton" type="button" value="somevalue" onclick="alert('Hello World!');">
<img src="someimage.gif" alt="someimage">
</button>
From: SelfHTML (German)
Try this:
echo "<form action=\"User_list.php?id=$row[1]&sec=$row[5]&subj=$row[6]&type=viewrec2&Year=$row[12]&faci=$row[9]\">";
echo " <button type=\"submit\" value=\"LIST\">";
echo " <img src=\"image.gif\" alt=\"LIST\"/>";
echo " </button>";
echo "</form>";
(Thanks to @guerda for his answer on how to include the image.)
You'll have to escape the '&'
characters, but I don't know how you do it in PHP.
Note that this can have a side effect if you have other forms in the same page.