PhpDig.net

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

Reply
 
Thread Tools
Old 12-19-2005, 03:09 AM   #1
g0ng
Green Mole
 
Join Date: Dec 2005
Posts: 1
can't figure out how to include search

I read some of the posts here but still can;t understand.

What I want is
1)Insert a simple box where someone can write a query.
2)Use a search.php to show the results.

In my menu I do:

$q.="<form action=\"search.php\" method=\"get\">\n";
$q.="<input type='hidden' name='template' value=''> <input type='hidden' name='site' value=''/><input type='hidden' name='path' value=''/>\n";
$q.="<input type='hidden' name='result_page' value='http://www.deypsy.gr/search.php'/>\n";
$q.="<input type=\"text\" name=\"query_string\" /></form>\n";

my search.php is:
$no_connect=0;
$relative_script_path = 'phpdig';
include("phpdig/includes/config.php");
include("phpdig/includes/connect.php");
include("phpdig/libs/search_function.php");

print "lala";
extract(phpdigHttpVars(
array('query_string'=>'string',
'template'=>'string',
'refine'=>'integer',
'refine_url'=>'string',
'site'=>'integer',
'limite'=>'integer',
'option'=>'string',
'search'=>'string',
'lim_start'=>'integer',
'browse'=>'integer',
'path'=>'string'
)
));
phpdigSearch($id_connect, $query_string, $option, $refine,$refine_url, $lim_start, $limite, $browse, $site, $path, $relative_script_path, $template, $adlog_flag, $rssdf);
?>


No when I search for a term it redirects me to search.php with a small search table. If I press go it then searches. (that means it requires 2 steps to search)

I don't understand what is wrong with this.
and one more question. Can I include the search results in my html pages? I have my menus, etc and what to do something like: <?php print searchResults();?>

tahnks

ps: you can see www.deypsy.gr though it's in greek you will understand the search input. ;-)
g0ng is offline   Reply With Quote
Old 12-26-2005, 08:02 PM   #2
alexp_p
Green Mole
 
Join Date: Dec 2005
Posts: 3
think this will help

I'm also new and did my own search with no trouble but i think it need to use POST instead of GET metho in the form, i used that why and works hope this help
alexp_p is offline   Reply With Quote
Reply


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
File include Iceburg Coding & Tutorials 0 12-09-2006 03:10 PM
include search.php OceanSurf How-to Forum 1 09-08-2004 10:58 AM
How to include just the text field from search form? scarpelius How-to Forum 1 08-10-2004 06:05 PM
How to use PHP include to include the Google result pages? sid Coding & Tutorials 1 01-07-2004 05:53 AM
Using PHP include in templates sid How-to Forum 3 11-23-2003 07:06 AM


All times are GMT -8. The time now is 07:54 AM.


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