Hi Sirs,

I have a problem with this php code from a php file.
The search querie will be like helpme.com/search.php?Keywords=Learn+Read

I want to show this querie "Learn+Read" in the title tag. How could I add this?


Here is the code:

<?php
// This script transforms XML -> HTML using XSLT
// Accepts HTML form input (GET or POST) for search keywords

// Enable Globals may be turned off
$QUERY_STRING = $_SERVER['QUERY_STRING'] ;
$REQUEST_METHOD = $_SERVER['REQUEST_METHOD'] ;

// Specify URL to XML and XSL documents
$xmlDoc = 'http://xml.helppeople.com/d/search/p/standard/eu/xml/helpyoungpeople/?mkt=uk&adultFilter=clean&maxCount=15&Keywords=';
$xslDoc = '/home/myintern/public_html/ma/helppeople.xsl';

// Load "Keywords" query from form (POST or GET)
// Replace blank spaces between keywords with '+'
if ($REQUEST_METHOD=='POST') {
$data = urlencode( $_POST['Keywords'] );
} elseif ($QUERY_STRING) {
$data = urlencode( $_GET['Keywords'] );
} else {
echo "<b>Missing XML Query — Use form (POST) or querystring (GET)</b>"; exit;
}
// Check for presence of NextArgs, PrevArgs and
// append to $data
if ($_GET['xargs'] ) {
$data .= "&xargs=" . $_GET['xargs'] ;
}

// Create a connection to the remote XML feed
// Read data into $xmlFeed variable
$xmlDoc .= "?Partner=_test&Keywords=$data";
$xmlConn = fopen ($xmlDoc, "r");
if (!$xmlConn) {
echo "<b>Connection to XML feed could not be established</b>"; exit;
} else {
do {
$data = fread($xmlConn,2048);
if( strlen( $data ) == 0 ) {
break;
}
$xmlFeed .= $data;
} while( true );
}
fclose($xmlConn);

// Open XSL Document
// Read data into $xslFeed variable
$xslConn = fopen ("$xslDoc", "r");
if (!$xslConn) {
echo "<b>XSL file could not be found</b>"; exit;
} else {
while ( $data= fread($xslConn,20000)) {$xslFeed .= $data;};
}
fclose($xslConn);

// Cannot pass regular variables as parameters to xslt_process() function
$arguments = array(
'/_xml' => $xmlFeed,
'/_xsl' => $xslFeed
);
// Transform XML with XSL -- return resulting HTML
$xsltproc = xslt_create();
$html = xslt_process($xsltproc, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
if (!$html) die('XSLT processing error: '.xslt_error($xsltproc));
xslt_free($xsltproc);
echo $html;
?>