I have a search form that refreshes the page when the submit button is hit with the table of results below. this works fine and the url is http://example.com/?txtKeyword=searchterm
I want it to add &sku=123456789
to the end of the url I know to add the sku from my database I need to use this term $_GET[sku]
. I have tried to add this to the form and I have been unsuccessful. Here is the form code:
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME']?>">
<table width="100%">
<tr>
<th>Search: (Keyword/SKU)
<input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>" size="40">
<input class="alert button" type="submit" value="Search"></th>
</tr>
</table>
</form>
I think I need to add this line:
<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME']'&sku='$_GET["sku"]?>">
This does not work. I am not too sure, trying to learn PHP and I cannot seem to find the problem or a solution. Am I doing this wrong and what would I need to do to get this right?