Hello! I am new to the world of PHP and to this forum.
Have any of you ever used a HTML image map to get inforation to php for handling? I know how to make an image map for links, mailtos, ext, but have no idea how to link data to a spot on an image.
Here is what I am trying to do:
I must design a image which represents a fake resturant. The user will be shown the layout of the floorplan first, and be able to click on the table they desire. The HTML image map will sumbit data to the php file to check against the mysql database and see what times that table is available, and give the user the option to reserve it. What would be the best way to do this?
Thank you for all of your time/help!
Image maps! Getting user input for later mysql and php...
Moderator: General Moderators
-
jakeyman_i_am
- Forum Newbie
- Posts: 3
- Joined: Wed Dec 06, 2006 6:04 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
It's been quite a while since I used an image map, so I may be off here.
If memory serves, you can tell the image map a specific URL to go to when clicking in the regions. This could be used to generate a get request.
I also seem to remember where it could send coordinates to the accepting page. This could also be used with a bit of math to know which table they clicked on, or empty space.
In either case it should be fairly simple.
If memory serves, you can tell the image map a specific URL to go to when clicking in the regions. This could be used to generate a get request.
I also seem to remember where it could send coordinates to the accepting page. This could also be used with a bit of math to know which table they clicked on, or empty space.
In either case it should be fairly simple.
-
jakeyman_i_am
- Forum Newbie
- Posts: 3
- Joined: Wed Dec 06, 2006 6:04 pm
ok so something like this your thinking:feyd wrote:If memory serves, you can tell the image map a specific URL to go to when clicking in the regions. This could be used to generate a get request.
Code: Select all
<img src ="planets.gif"
width ="145" height ="126"
alt="Planets"
usemap ="#planetmap" />
<map id ="planetmap"
name="planetmap">
<area shape ="rect" coords ="0,0,82,126"
href ="target.php" value="clicked1" target ="_blank"
alt="Sun" />
<area shape ="circle" coords ="90,58,3"
href ="target.php" value="clicked2" target ="_blank"
alt="Mercury" />
</map>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
jakeyman_i_am
- Forum Newbie
- Posts: 3
- Joined: Wed Dec 06, 2006 6:04 pm
Ok, I will give that a swing tomorrow, and report how it goes. Thank you both very much!Jcart wrote:yea, except change your href to indicate what room you looked on, for instance, href ="target.php?roomid=14", to which you can access using $_GET['roomid'] and perform neccesary checks your database.