version 2.0
This works for both .asp and .php versions.
It is updaterproof, meaning this will not get overwritten when you update your store.
The code is slightly different for .asp and .php versions
This will work regardless if you are using the nobox=true parameter.
This is conditional so if no search term is entered, then nothing will display.
EDITED - Thanks to Marshall's post below, code has been edited to work with nobox setting.
It will show the text that the user searched for.
Link to demo below
==HOW TO INSTALL==
===ASP VERSION===1. Open your search.asp page in your html editor.
2. In the content area of the page you will find the include line as follows
<!--#include file="vsadmin/inc/incsearch.asp"-->
Just above that, add the following line
<div class="searchedfor" id="searchedfor"></div>
3. Just below that, add the following
<script>
if ('<%=htmlspecials(request("stext"))%>' != '') {
var searchedfor = ('Showing results for: <%=htmlspecials(request("stext"))%>');
document.getElementById('searchedfor').innerHTML = searchedfor;
}
</script>
4. Upload to the server.
********************************************************************
===PHP VERSION===1. Open your search.php page in your html editor.
2. In the content area of the page you will find the include line as follows
<?php include "vsadmin/inc/incsearch.php" ?>
Just above that, add the following line
<div class="searchedfor" id="searchedfor"></div>
3. Just below that, add the following
<script>
if ('<?php print htmlspecials($stext)?>' != '') {
var searchedfor = ('Showing results for: <?php print htmlspecials($stext)?>');
document.getElementById('searchedfor').innerHTML = searchedfor;
}
</script>
4. Upload to the server.
***************************************************************
This is written so nothing happens if no search term is entered and a visitor just navigates to the search page with no search term.
It can be styled with the class "searchedfor".
div.searchedfor {color:red; font-weight:bold; font-size:16px;} for example
The text there in the script
Showing results for: can be changed to anything you like.
Demo here - http://www.floridasurpluswarehouse.com/dev/search.php?pg=1&stext=monitor
As stated, when no search term is entered, there is no output there http://www.floridasurpluswarehouse.com/dev/search.php
Enjoy...