Jump to content

Multiple '?'s in URL?


vigiw

Recommended Posts

???I am trying to get multiple outputs to display in a text field.  It is an image map, which if I click one hotspot, it will display in the proper form field, however, if I click another, the newest hotspot selection will replace the previous one.

They are found with a file.php?blah=selected type situation, here is in the image map code at the top of the PHP form page:

[code]<MAP NAME=mymap>

<area href="submit.php?hampden=selected<?php if($_GET['hampden']) echo "&amp;hampden=" . $_GET['hampden'] ?>" ALT="Hampden County" shape="polygon" coords="125, 199, 168, 201, 167, 205, 176, 209, 181, 200, 216, 203, 287, 202, 295, 201, 295, 174, 286, 171, 280, 167, 274, 165, 274, 156, 264, 153, 257, 158, 255, 162, 249, 161, 246, 155, 211, 156, 207, 153, 209, 142, 206, 143, 202, 148, 197, 155, 192, 163, 179, 160, 174, 153, 165, 155, 158, 149, 155, 149, 156, 131, 153, 124, 139, 131, 136, 136, 131, 168, 123, 174">
<area href="submit.php?berkshire=selected<?php if($_GET['berkshire']) echo "&amp;berkshire=" . $_GET['berkshire'] ?>" ALT="Berkshire County" coords="42, 196, 125, 200, 123, 175, 131, 170, 136, 135, 131, 132, 126, 128, 126, 115, 136, 118, 138, 94, 148, 28, 90, 25, 85, 30, 54, 131, 51, 145, 44, 175" shape=polygon>
<area href="submit.php?hampshire=selected<?php if($_GET['hampden']) echo "&amp;hampshire=" . $_GET['hampshire'] ?>" shape="polygon" coords="140, 75, 158, 78, 162, 91, 183, 98, 186, 98, 190, 98, 191, 107, 200, 109, 224, 105, 234, 108, 249, 108, 269, 123, 271, 135, 278, 135, 280, 146, 277, 154, 274, 155, 264, 153, 253, 161, 249, 161, 245, 156, 205, 155, 208, 143, 192, 161, 178, 162, 172, 152, 166, 153, 156, 145, 155, 127, 152, 125, 136, 134, 126, 126, 127, 116, 132, 118, 133, 118, 138, 102">
<area href="submit.php?franklin=selected<?php if($_GET['franklin']) echo "&amp;franklin=" . $_GET['franklin'] ?>" shape="polygon" coords="257, 114, 268, 92, 274, 80, 271, 71, 272, 61, 279, 51, 270, 43, 268, 33, 266, 30, 148, 30, 141, 76, 156, 77, 167, 93, 188, 99, 189, 100, 192, 108, 226, 105, 249, 109">
<area href="submit.php?worcester=selected<?php if($_GET['worcester']) echo "&amp;worcester=" . $_GET['worcester'] ?>" shape="polygon" coords="294, 202, 364, 207, 414, 205, 413, 171, 396, 159, 392, 154, 400, 146, 409, 142, 413, 133, 409, 129, 397, 127, 395, 129, 392, 122, 404, 104, 405, 80, 397, 74, 380, 82, 381, 74, 381, 67, 373, 55, 362, 50, 343, 54, 348, 40, 342, 37, 266, 30, 272, 42, 278, 52, 271, 66, 272, 80, 266, 95, 259, 114, 269, 121, 271, 136, 276, 136, 280, 137, 278, 152, 272, 160, 283, 173, 294, 174, 295, 184">
<area href="submit.php?litchfield=selected<?php if($_GET['litchfield']) echo "&amp;litchfield=" . $_GET['litchfield'] ?>" shape="polygon" coords="42, 197, 39, 295, 57, 332, 105, 331, 124, 311, 139, 302, 142, 289, 132, 276, 132, 265, 134, 259, 151, 259, 145, 255, 145, 250, 145, 240, 148, 236, 156, 218, 133, 218, 136, 200">
<area href="submit.php?hartford=selected<?php if($_GET['hartford']) echo "&amp;hartford=" . $_GET['hartford'] ?>" shape="polygon" coords="141, 297, 149, 317, 169, 318, 199, 307, 223, 304, 239, 307, 243, 304, 236, 291, 229, 252, 228, 247, 223, 240, 226, 203, 182, 201, 175, 209, 167, 205, 165, 200, 136, 200, 134, 215, 155, 219, 145, 243, 147, 255, 149, 258, 133, 261, 132, 276, 139, 288">
<area href="submit.php?tolland=selected<?php if($_GET['tolland']) echo "&amp;tolland=" . $_GET['tolland'] ?>" shape="polygon" coords="227, 205, 227, 222, 225, 235, 226, 243, 241, 308, 254, 306, 260, 298, 275, 280, 279, 275, 288, 264, 286, 255, 282, 249, 281, 221, 297, 221, 305, 204, 283, 201">
<area href="submit.php?windham=selected<?php if($_GET['windham']) echo "&amp;windham=" . $_GET['windham'] ?>" shape="polygon" coords="273, 281, 304, 303, 357, 295, 355, 207, 306, 204, 297, 222, 282, 219, 282, 249, 287, 262">


</MAP>
<IMG SRC="http://www.vigilantweather.com/forecast/maps/sfd.jpg" ALT="Site map" USEMAP="#mymap" WIDTH=445 HEIGHT=457>[/code]

Here is the form field's code:

[code]<textarea name="field4" rows="9" cols="78"><?php
if($_GET['hampden'] == "selected") echo "Hampden, ";
if($_GET['berkshire'] == "selected") echo "Berkshire, ";
if($_GET['hampshire'] == "selected") echo "Hampshire, ";
if($_GET['franklin'] == "selected") echo "Franklin, ";
if($_GET['worcester'] == "selected") echo "Worcester, ";
if($_GET['litchfield'] == "selected") echo "Litchfield, ";
if($_GET['hartford'] == "selected") echo "Hartford, ";
if($_GET['tolland'] == "selected") echo "Tolland, ";
if($_GET['windham'] == "selected") echo "Windham, ";
?></textarea>
[/code]

Note that is just the image map part and not the full page code.  Is there a way to make it so I can have multiple counties shown in the form field if multiple are selected at one time.  Like if Berkshire and Hampshire were both to be selected, or whatever necessary.

I am very puzzled and can't figure this out! >:(

Any help appreciated--thanks!
Link to comment
https://forums.phpfreaks.com/topic/34447-multiple-s-in-url/
Share on other sites

I don't see how you can have multiple selections with your current setup. You are using an image map, so the user can only select one "location". The only solution I can think of using an image map would be to use javascript to build the url as they click multiple locations. But, then you would also need to include functionality for the user to remove locations.

Perhaps, you need to find another site that has functionality that is similar to what you want and then build your solution around that.
Link to comment
https://forums.phpfreaks.com/topic/34447-multiple-s-in-url/#findComment-162227
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.