View Single Post
Old 09-04-2005, 09:59 AM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
In test.htm find:
Code:
<form action="http://www.aboutautism.org.uk/phpDig/search.php" target="search.htm" method="post">
<input type="text" name="query_string" value="">
<input type="submit" name="search" value="Go">
</form>
And replace with:
Code:
<script language="JavaScript">
function setCookie(name1, name2, expires, path, domain, secure) {
        var querynam = 'query_string';
        var queryval = document.forms[name1].elements[name2].value;
        document.cookie= querynam + "=" + escape(queryval) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
</script>

<form name="query_form" action="search.htm" method="post" onsubmit="setCookie('query_form','query_string')">
<input type="text" name="query_string" value="">
<input type="submit" name="search" value="Go">
</form>
In search.php find:
Code:
if (ALLOW_RSS_FEED) {
And beforehand add:
Code:
if (strlen($query_string) == 0 && isset($_COOKIE['query_string'])) {
	if (strlen($_COOKIE['query_string']) > 0) {
		$query_string = $_COOKIE['query_string'];
		$_COOKIE['query_string'] = '';
	}
}
Keep the IFRAME in search.htm and see if these changes work.

If these changes don't work, the above may need tweaking or you can make a template like those in the templates folder.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote