Re: Using custom "button" form element instead of standard "submit"?
| From: | 1LT John W. Holmes | Date: | Thu, 30 Jan 2003 13:20:04 +0000 |
| Subject: | Re: Using custom "button" form element instead of standard "submit"? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133638@lists.php.net to get a copy of this message | ||
> At 13:37 30.01.2003, Durwood Gafford spoke out and said:
> --------------------[snip]--------------------
> ><input type="submit" name="sample" value="a" >
> ><input type="submit" name="sample" value="b" >
> ><input type="submit" name="sample" value="c" >
> ><input type="submit" name="sample" value="d" >
> >
> >your php form handler can now simply do:
> >
> >print "The user selected button $sample<br>\n")
If that's what you want, then just make each button a normal <a href> link
and pass an variable to the next page in the link (like someone has already
suggested). You'd get the same end result.
<a href="page.php?sample=a"><img></a>
<a href="page.php?sample=b"><img></a>
<a href="page.php?sample=c"><img></a>
<a href="page.php?sample=d"><img></a>
print "The user selected button $sample<br>\n";
---John Holmes...