![]() |
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 |
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. |
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 |
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> ?> |
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 |
|
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 |
From php.net:
return.php PHP Code:
PHP Code:
PHP Code:
|
All times are GMT -8. The time now is 09:55 PM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.