Click to See Complete Forum and Search --> : submit as image button in php


Anon
01-03-2001, 06:32 AM
i have problem about submit form
here it is

echo "<input type=submit name=submitbutton[selectall] value=\"" . $Select["Select Al
l"] . "\">\n";

i want to change it as image button but it never working when i replace word submit as image +src

someone help me ,please.

vincente
01-03-2001, 07:32 AM
isn't it :<input type=image src=bla.jpg name=submitbutton value=bla>

Anon
01-04-2001, 12:18 PM
There's nothing wrong with this, the only thing I can see is that maybe its the fact that you have not put the bits in speech marks.

<input type='image' src='image.gif' border='0'> etc

Anon
05-05-2001, 07:43 AM
probaly the problem was that the script uses submit button name to decide what to do.
something like that:

<form action=test.php method=post>
<input type="text" name="val" value="<? echo $val;?>"><br>
<input type="image" src=image/some.gif name="first" value="lala" border=0>
<input type="image" src=image/some.gif name="second" value="lulu" border=0>
</form>

<?

if ($first_x){
echo "first";
} else if ($second_x){
echo "second";
}

?>

note, use VARNAME_x - php split var name to _x and _y

Anon
03-23-2002, 09:21 AM
I'm having problems with submit images too. My form works fine when I've a <input type="submit"... in. I then use a "if ($submit) { ... }" type arrangement. As soon as I try and replace that with <input type="image" src="img.gif" name="submit"....
it stops working.

Anon
03-23-2002, 09:34 AM
OK, figured out my problem anyway. Php takes the TWO values $button_x and $button_y when a user clicks on an image button called "button" to pass the x and y of where the user clicked.
Testing for "if ($button){..." is no good. Simply replace that with "if ($button_x > "0"){..." That solved my problem. hope it helps ;)

Anon
06-21-2002, 05:29 AM
While I use get method when post does NOT work,I get this:

map.x=151&map.y=25

NOT:

map_x=151&map_y=25

echo $map_x;
echo $map_y;

nothing output.

anyone can help me?

win98/ie6



chase wrote:
-------------------------------
OK, figured out my problem anyway. Php takes the TWO values $button_x and $button_y when a user clicks on an image button called "button" to pass the x and y of where the user clicked.
Testing for "if ($button){..." is no good. Simply replace that with "if ($button_x > "0"){..." That solved my problem. hope it helps ;)