|
12-01-2004, 06:38 AM | #1 |
Green Mole
Join Date: Jun 2004
Location: Italy
Posts: 6
|
Php code in results
Hello,
I'd like to have some infos regarding how include a php code string in result page. Actually, as obvious, php has not parsed. I setup an header in .php and it works (I follow the forum instructions to do it) but I cannot insert a php string before all results of my search. Any idea or thread you know to setup the script? Thank you Jacopo |
12-01-2004, 06:36 PM | #2 |
Purple Mole
Join Date: Jan 2004
Posts: 694
|
Did you look at the documentation where it mentions the different entities that are available for the search results page?
If that isn't the type of thing you're looking for, please give us an example of the type of output you're seeking. |
12-02-2004, 03:52 AM | #3 |
Green Mole
Join Date: Jun 2004
Location: Italy
Posts: 6
|
Thank you for reply. I looked at that but I need a custom entity.
I need this: When people search at this page: http://www.grandepadre.com/spider/ i.e. the keyword internet in the result page I include this string <script src="http://www.massmediem.com/smartsearch/include.cgi?keywords=<? echo $query_string; ?>&java=1"></script> that return me also other results for the keyword. But the php code hasn't parsed and return exactly as I wrote in the code. How could I setup the code for parse php in this contest? Thank you for any ideas. Jacopo |
12-02-2004, 11:59 AM | #4 |
Green Mole
Join Date: Dec 2004
Posts: 10
|
a simple solution I implemented
I would assume the code in your header will allow you to call the script tag. with that being the case this will put the results at the bottom of the results page. Its a start.
Use the include file so it will be easy to move arond the code later. Here is what i did that got something working around line 765 in libs/search_function.php I added an include line: } $timer->stop('Template parsing'); $timer->stop('All display'); $timer->stop('All'); //$timer->display(); //I included this line here and it is around line 765 but the other code in this snippet comes directly from the file. include "lexicon.inc"; } function by_length($a, $b) { $len_a = strlen($a); $len_b = strlen($b); if ($len_a == $len_b) { return 0; } return ($len_a < $len_b) ? 1 : -1; } in lexicon.inc do this: <?php; <script src="http://www.massmediem.com/smartsearch/include.cgi?keywords=<? echo $query_string; ?>&java=1"></script> ?> |
12-03-2004, 06:49 AM | #5 |
Green Mole
Join Date: Jun 2004
Location: Italy
Posts: 6
|
Hi,
that's good but there's still the problem that lexicon code is on the top of the page or at the bottom of the page. I need it before results. Jacopo |
12-03-2004, 06:51 AM | #6 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
__________________
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. |
12-03-2004, 08:31 AM | #7 |
Green Mole
Join Date: Jun 2004
Location: Italy
Posts: 6
|
Still no way to parse that code but I've found something interesting IMHO.
Putting header and footer they always goes at the top of the page. So I create a new .php header with more code including all before form search mask. It still gave me problems at the top of the code. To avoid this change this: <?xml version="1.0" encoding="ISO-8859-1"?> with this: <?php echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"; ?> But still other issues in the code. 1) Now it appear the number "1" in the middle of the page. Nobody knowns what is that? 2) Still have problem to include code beetween form mask and search results. Jacopo |
12-03-2004, 10:42 PM | #8 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
From php.net:
return.php PHP Code:
PHP Code:
PHP Code:
__________________
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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I integrate results pages into a php site? | RubiconCSL | How-to Forum | 0 | 05-30-2006 05:52 AM |
show results in an include (php) | vuurvos | How-to Forum | 1 | 10-05-2005 07:44 AM |
Affiliate code | JPSSAU | How-to Forum | 1 | 06-19-2004 06:51 AM |
Code Requests | Charter | Feedback & News | 0 | 02-29-2004 12:45 AM |
Documented code | alivin70 | Mod Submissions | 1 | 10-06-2003 03:34 PM |