Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
I'm hoping someone can help resolve my problem, or at least tell me whether it's possible or not so I can elect another option.
[b]OBJECTIVE[/b]
I want to call a particular function of a PHP script, a queried term, and print it to the <title> and/or <h1> tag of a document on the fly for a given search.
[b]THE SCRIPT[/b]
The script in question is the Zoom search engine (PHP install). The script is called and the search results are created by virtue of an include [color=red]<?php include("search.php"); ?>[/color] which is inserted into my website's .php template file.
[b]PROBLEM[/b]
Unlike most off-the-shelf site search scripts, Zoom doesn't generate page titles at top of the page for a particular query. Further, all requests (so far) to Zoom's support staff have been ignored.
[b]ESTABLISHED[/b]
I have been successful inserting the query term using [color=blue]<?php print "$query"; ?>[/color] however, it will only work when placed below the point of where the script include is added to the template, seemingly since the script's code is called (and search results generated) between the template's header and footer.
[b]SUMMARY[/b]
It may be possible to use [color=blue]<?php print "$query"; ?>[/color] to generate the searched term in various other areas on the page, however I don't have the requisite skills to code the template to facilitate the task. I theorize that it may possible to do this using code I'm unfamiliar with -- such as a type of "include() once" placed at top of the template's code.
Could a language construct such as echo(), print(), include(), or require() be added to beginning of the template file to call the $query so as to print to placeholders within the page titles and heading tags?Code: Select all
<?php
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php print("$query"); ?></title>
<h1><?php print("$query"); ?></h1>Apache/1.3.37
PHP/4.3.10
...any help appreciated. Thanks.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]