Jump to content

PHP INTERACTIVE MAP


phpwannabe25

Recommended Posts

hey,

 

I have a list of locations in a list from a standard select form.  i am using a "post" and to post this value to the next page.

 

This is no problem.  The code i am using as follows is

 

	<form name="selectcounty" method="post" action="viewhotels2.php">	
<p align="left">Select Location of Hotel:<select name="county">   
  <option value="antrim">Antrim</option>
  <option value="armagh">Armagh</option>
  <option value="carlow">Carlow</option>
  <option value="cavan">Cavan</option>
<input type="submit" name="Submit" value="Submit"><br>
  
			  <input type="reset" name="Reset" value="Reset">
</form>

 

 

 

 

This works fine however i am now attemptin to replace this list with a map, and when the user selects that  area on the map, bascially same as above, the location will be posted to the enxt page.

 

so far i ahve the map workin fine, however it is not postin to the nexxt page.

the code so far is





<form name="selectcounty" value="county" method="post">	
                             
<IMG border=0 alt="Ireland Counties" 
src="countymap.gif" 
width=352 height=397 useMap=#Map> 

<MAP id=Map 
name=Map>

<value="antrim">
<AREA 
href="viewhotels2.php" 
shape=poly alt="Armagh" 
coords=291,102,292,79,276,72,261,85,
</value>

<value="down">
<AREA 
href="viewhotels2.php" 
shape=poly alt="Down" 
coords=329,103,344,77,326,65,295,83,304,112>
</value>


<value="fermanagh">
<AREA 
href="viewhotels2.php" 
shape=poly alt="Fermanagh" 
coords=237,94,228,78,203,63,193,78,217,94>
</value>

</MAP>
</form>


[code]

so far, this is not postin the value to the second page, and thsi is my problem

any help?

thanks!

Link to comment
https://forums.phpfreaks.com/topic/173609-php-interactive-map/
Share on other sites

That is because image map has nothing to do with form and there is not such a thing as <value=""> in MAP http://www.w3schools.com/TAGS/tag_map.asp . You could pass the county name as $_GET variable in the links to the other page.

 

<value="down">
<AREA
href="viewhotels2.php?county=antrim"
shape=poly alt="Down"
coords=329,103,344,77,326,65,295,83,304,112>
</value>

 

..would have on page viewhotels a $_GET['county'] with a value of "antrim" when user has clicked the link.

Link to comment
https://forums.phpfreaks.com/topic/173609-php-interactive-map/#findComment-915296
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.