Re: submitbutton/imagebutton
| From: | Paul Burney | Date: | Fri, 22 Jun 2001 17:38:59 +0000 |
| Subject: | Re: submitbutton/imagebutton | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-9747@lists.php.net to get a copy of this message | ||
on 6/22/01 6:10 AM, Jan de Koster at jandk@demorgen.be wrote:
> I'm kind of new to php so there may be an obvious answer but I can't
> find it for the moment.
Look at the PHP FAQ, it's a great place to start:
<http://php.net/FAQ.php>
> In pure HTML there is of course no problem, the image is still used as a
> submit button but... the submit type is being passed on to a php script
> ( ...if ($submit) {...) that makes a qeary to a mysql database. When I
> change the type=submit to type=image the script doesn't pick up the
> submit value anymore, so nothing happens.
<quote>
7.13. I'm trying to use an <input type="image"> tag, but the $foo.x and
$foo.y variables aren't available. Where are they?
When submitting a form, it is possible to use an image instead of the
standard submit button with a tag like:
<input type="image" SRC="image.gif" NAME="foo">
When the user clicks somewhere on the image, the accompanying form will be
transmitted to the server with two additional variables: foo.x and foo.y.
Because $foo.x and $foo.y are invalid variable names in PHP, they are
automagically converted to $foo_x and $foo_y. That is, the periods are
replaced with underscores.
</quote>
So basically, instead of checking for $submit, do something like:
... if (isset($submit_x)) { ...
Sincerely,
Paul Burney
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<webmaster@gseis.ucla.edu>
<http://www.gseis.ucla.edu/>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++