Site1: http://www.sitea.com
Site2: http://www.siteb.com
I would like to use the input field value from Site1 to build an url within a <a href=""> element that will point to Site2. This will be used to access search functionality of another site.
Example: input value = test-search
URL: http://www.siteb.com/#!q=test-search?parameter1
My attempt look like this:
<form action="index.php" method="GET">
<input type="search" name="search" />
</form>
<a href="https://www.siteb.com/#!q=<?php echo $_GET['search']; ?>?parameter1">Search</a>
I was looking through different tuttorials but could not find one that will use PHP to pass the value of the input field and build the URL.
Please note: I am limited to PHP only and no JS at all.
AMP example: - link to example
<form method="GET"
class="p2"
action="/components/amp-form/submit-form"
target="_top">
<div class="ampstart-input inline-block relative mb3">
<input type="search"
placeholder="Search..."
name="googlesearch">
</div>
<input type="submit"
value="OK"
class="ampstart-btn caps">
</form>