<form action="/en2/maps-<?php echo $id; ?>/?=. ($_GET['textSearchTerms']).&=. ($_GET['locationSearchTerms'])."><!--Relative url to the page that your map is on-->
Distination:
<select name="textSearchTerms" class="selectpicker" data-live-search="true">
<option value="alfamart">Alfamart</option>
<option value="BCA">BCA</option>
</select>
Location:
<input type="text" name="locationSearchTerms">
<input type="submit" value="Search">
</form>
<form action="/en2/maps-<?php echo $id; ?>
not work... any idea?
I want this link for my form action:
http://indonesia.com/en2/maps-alfamart/?textSearchTerms=alfamart&locationSearchTerms=denpasar
thanks
Use like this
<?php
$id="alfamart";
$textSearchTerms = isset($_GET['textSearchTerms']) ? $_GET['textSearchTerms'] : "";
$locationSearchTerms = isset($_GET['locationSearchTerms']) ? $_GET['locationSearchTerms'] : "";
$url = "/en2/maps-".$id."/?textSearchTerms=".$textSearchTerms."&locationSearchTerms=".$locationSearchTerms;
?>
<form action="<?php echo $url; ?>" method="GET">
Distination:
<select name="textSearchTerms" class="selectpicker" data-live-search="true">
<option value="alfamart">Alfamart</option>
<option value="BCA">BCA</option>
</select>
Location:
<input type="text" name="locationSearchTerms">
<input type="submit" value="Search">
</form>
Added form method GET and your php variable in php tag
Replace
<form action="/en2/maps-<?php echo $id; ?>/?=. ($_GET['textSearchTerms']).&=. ($_GET['locationSearchTerms']).">
with
<form action="/en2/maps-<?php echo $id; ?>/?textSearchTerms=<?php echo $_GET['textSearchTerms']; ?>&locationSearchTerms=<?php echo $_GET['locationSearchTerms']; ?>">
Note:- You missed textSearchTerms
and locationSearchTerms
in your form action parameter before =
.