faqts : Computers : Programming : Languages : PHP : Sample Code

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

76 of 100 people (76%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How can I use image file as submit button?

Feb 20th, 2005 03:27
Devis Lucato, Ken SSS, Penton Wong,


<form action='' method='post' style='margin:0'>
 <input type='image' name='submit' src='images/search.gif' border='0'
alt='Click here to search' align='absmiddle'>
</form>
Here would be the results from the above. 
The image submit returns 2 values , the _x & _y position of where your 
mouse is when you clicked on the button.
So it would look like this
$_POST['submit_x']  //mite return a value of 24
$_POST['submit_y']  //mite return a value of 12
Again it depends on where the mouse is positioned. You could always do
this: <input type='hidden' name='submit' value='submit'>