PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 09-02-2005, 04:02 AM   #1
aboutautism
Green Mole
 
Join Date: Sep 2005
Posts: 4
Question Redirecting search results to iframe

Hi
I have installed phpdig to my site:
http://www.aboutautism.org.uk/phpDig/search.php

I have created a basic page with the form from the documentation page:
http://www.aboutautism.org.uk/test.htm

I have a search results page:
http://www.aboutautism.org.uk/search.htm

Is there a way in which I can target the search queerys from my form to appear in my results page?

I would like to incorporate the form into my default template so that it is available on all pages.
aboutautism is offline   Reply With Quote
Old 09-03-2005, 02:39 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Does this thread get the results that you want?
__________________
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
Old 09-04-2005, 12:17 AM   #3
aboutautism
Green Mole
 
Join Date: Sep 2005
Posts: 4
Thanks, yes this has helped

Thank you.
The form is now posting correctly, but it still brings up the search results in a new window, I think my problem is that I am using iframes as opposed to normal frames.
My form is thus:

<form action="http://www.aboutautism.org.uk/phpDig/search.php" target="search_results_frame" method="post">
<input type="text" name="query_string" value="">
<input type="submit" name="search" value="Go">
</form>


I have set
$result['form_head'] = "<form target='search_results_frame' action='$result_page' method='post'>
in the three locations within phpdig_functions.php as suggested.

I have created a search page, search.htm which contains an <iframe> which I have called 'search' using the 'name' function.

When I submit on my test page (test.htm) I need the search to appear within the <iframe> that exists within search.htm.

Is this possible?

Thanks

Martin
aboutautism is offline   Reply With Quote
Old 09-04-2005, 07:31 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
When I do a search at http://www.aboutautism.org.uk/search.htm I see the search results in a frame. When I click one the the search result links, the page opens in a new window. If it is the latter you want in the same window, look for LINK_TARGET in the config file.
__________________
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
Old 09-04-2005, 07:52 AM   #5
aboutautism
Green Mole
 
Join Date: Sep 2005
Posts: 4
Charter
Thanks for that - the links in the search page are now working much better

I am however, still stuck with my search form that I wanted to incorporate on all of my pages (see www.aboutautism.org.uk/test.htm)

Do you know if I can target my html search page ?
The html search page is www.aboutautism.org.uk/search.htm

Thanks for helping

martin
aboutautism is offline   Reply With Quote
Old 09-04-2005, 10: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
Old 09-04-2005, 01:24 PM   #7
aboutautism
Green Mole
 
Join Date: Sep 2005
Posts: 4
Sorted!!!

Thank you very much - this worked perfectly and I will now replicate test.htm to my main template / other pages.

Martin
aboutautism is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting search results by URL at the search form level innerfire How-to Forum 3 08-01-2005 09:36 AM
Pulling search results into existing search system. satcom How-to Forum 2 05-03-2005 11:58 AM
No most searched terms, biggest results, most 0 results, last search queries, etc. jongag1 How-to Forum 6 04-22-2005 11:43 AM
won't install - keeps redirecting to login page sbrazil Script Installation 3 09-24-2004 06:47 PM
Search on search results page not working bforsyth Troubleshooting 10 08-20-2004 10:35 PM


All times are GMT -8. The time now is 12:26 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.