Re: Submit buttons as images
| From: | David Robley | Date: | Fri, 06 Oct 2000 02:17:09 +0000 |
| Subject: | Re: Submit buttons as images | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18814@lists.php.net to get a copy of this message | ||
On Fri, 06 Oct 2000, Ben Wiechman wrote:
> How do you determine which submit button was pressed if you are using images
> instead of standard buttons for form data submission.
>
> I am having a problem with a form I'm working on. Basically the user enters
> some information, reads an agreement (yeah right... lol) and either clicks
> Agree or Disagree. My problem is that when I got rid of the std html buttons
> in favor of a pair of images that went along with the site design better, I
> can no longer figure out for the life of me which button was pressed.
>
> I know in perl/cgi scripts you can access the x or y co-ords of the image to
> figure out which one was pressed, but trying flavors of this with PHP didn't
> work.
>
> Can anyone shed some light on this?
>
> Thanks in advance.
>
> Ben
If you read the coordinates as buttonname_x and buttonname_y (note
underscore instead of period) it will work.
The period is an invalid character in a variable name in PHP - it is as you
probably realise the concatenation character.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA