This topic is locked

Put a seach box on another page

6/8/2009 11:45:52 AM
PHPRunner Tips and Tricks
hfg author

I actually found this from an earlier post, but given my difficulty in finding it I am putting a copy here so others can find a very useful tip.
If you want to put a search box on another page (even a different web site) you can use the code below. Replace ..._list.php with the actual list page you want (or a full web address, i.e. http://www.yoursite.com/yourpage_list.php)).
You can change "Contains" to one the other search options if you wish. You can also add a search field value if you want to limit the search to a particular field in your project (i.e. name="SearchField" value="Company")

<FORM name=frmSearch action="..._list.php" method=get target=_blank>

<input type="Hidden" name="a" value="search">

<input type="Hidden" name="value" value="1">

<INPUT type=text name="SearchFor"

onkeydown="e=event; if(!e) e = window.event; if (e.keyCode != 13) return true; e.cancel = true; frmSearch.submit(); return false;"

>

<input type="Hidden" name="SearchOption" value="Contains">

<input type="Hidden" name="SearchField" value="">
<input type="submit" value="Search">

</FORM>


My thanks to Sergey for posting this earlier.

D
diaster 6/25/2009

I actually found this from an earlier post, but given my difficulty in finding it I am putting a copy here so others can find a very useful tip.

If you want to put a search box on another page (even a different web site) you can use the code below. Replace ..._list.php with the actual list page you want (or a full web address, i.e. http://www.yoursite.com/yourpage_list.php)).
You can change "Contains" to one the other search options if you wish. You can also add a search field value if you want to limit the search to a particular field in your project (i.e. name="SearchField" value="Company")
My thanks to Sergey for posting this earlier.



so how would i modify this to search three different fields. example CITY STATE ZIP with one search button for submit. I could enter any or all the fields for "contains" data. and perhaps have the the name CITY show up in the city box, etc, as to hint that's what you might enter there.