View Full Version : .shtml pages and including borders

12-23-2003, 11:31 PM
Can I alter the search results page to include like the header, footer, left side and right side using SSI. I am currently using .shtml on all of my pages.

12-29-2003, 06:26 PM
Hi. Please see this (http://www.phpdig.net/showthread.php?threadid=339) thread.

01-07-2004, 12:48 AM
Parse error: parse error in /home/httpd/vhosts/jaspergifts.com/httpdocs/searchsite/search.php on line 560

It doesn't work for me. I am putting including an cgi script and it doesn't like it. This isn't a simple header or footer. Any suggestions?

Here is what it looks like at line 550:

$my_page_searchfeed = get_my_includes("/home/httpd/vhosts/jaspergifts.com/cgi-bin/searchweb/include.cgi?keywords=$query_string&external=1&show=10");

Where $query_string is what the people typed in.

01-07-2004, 01:29 AM
This simple line inserted into search.php does the trick for one word searches:

<? readfile("http://jaspergifts.com/cgi-bin/searchweb/include.cgi?keywords=$query_string&external=1&show=10"); ?>

But when you give phpdig a two word search you get the following:

Warning: readfile("http://jaspergifts.com/cgi-bin/searchweb/include.cgi?keywords=gift baskets&external=1&show=10") - Success in /home/httpd/vhosts/jaspergifts.com/httpdocs/searchsite/search.php on line 558

I am assuming it is the space that it doesn't like. Any ideas?

01-07-2004, 04:49 AM
Hi. Prehaps try the following:

$query_string = urlencode($query_string);

Depending on where you place readfile in search.php, you may wish to define a new variable and use that instead as $query_string is passed to phpdigSearch. You may also wish to clean that variable too before passing it to readfile.

01-07-2004, 08:46 AM
Thanks Charter. I am placing the readfile before the phpdig results in search.php. Quick questions:

1. How and where do I define a new variable? What would the syntax be, what file would I put it in and where in the file would I put it?

2. How do I clean the variable?


01-07-2004, 01:54 PM
Hi. Take a look in search_function.php for $query_to_parse and you'll see various things done to clean the $query_string variable. Then in search.php you could do something like the following:

$query_string_for_readfile = $query_string;
// clean the $query_string_for_readfile variable
// readfile line here using $query_string_for_readfile

01-08-2004, 01:04 AM
Good work. Between the two of us we have solved another part of this ongoing puzzle - future people will wonder how to do this:-)