PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   .shtml pages and including borders (http://www.phpdig.net/forum/showthread.php?t=329)

Nosmada 12-23-2003 10:31 PM

.shtml pages and including borders
 
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.

Charter 12-29-2003 05:26 PM

Hi. Please see this thread.

Nosmada 01-06-2004 11:48 PM

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.

Nosmada 01-07-2004 12:29 AM

Getting closer to inserting a dynamic cgi script include
 
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?

Charter 01-07-2004 03:49 AM

Hi. Prehaps try the following:
PHP Code:

$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.

Nosmada 01-07-2004 07: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?

Thanks

Charter 01-07-2004 12: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:
PHP Code:

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


Nosmada 01-08-2004 12:04 AM

It is a wrap
 
Good work. Between the two of us we have solved another part of this ongoing puzzle - future people will wonder how to do this:-)


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

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