Forum Moderators: open
<?php if ($REQUEST_METHOD=='POST') {
$titlu = urlencode( $_POST['Keywords'] );
} elseif ($QUERY_STRING) {
$titlu = urlencode( $_GET['Keywords'] );
} else {
echo "<b>Missing XML Query — Use form (POST) or querystring (GET)</b>"; exit;
}?>
<title><?php echo $titlu ;?></title>
The title is with "-" between keywords when a search is performed.
For exemple, the title tag will be: Make-Advertising
How to remove -?
Danni
<?php if ($REQUEST_METHOD=='POST') {
$titlu = urlencode( $_POST['Keywords'] );
} elseif ($QUERY_STRING) {
$titlu = urlencode( $_GET['Keywords'] );
} else {
echo "<b>Missing XML Query — Use form (POST) or querystring (GET)</b>"; exit;
}
$titlu = str_replace("-", " ", $titlu);
?><title><?php echo $titlu ;?></title>
Best wishes
Michal Cibor
I recommend [pl.php.net...]
$titlu = str_replace($what_to_replace, $replace_with, $titlu);
I really recommend seeing the page: [pl.php.net...]
Best regards
Michal Cibor
The spaces in a string can be replaced with +'s using:
$titlu = urlencode($titlu);
If you want to replace with - with + too try:
$titlu = urlencode(str_replace('-', '+', $titlu));
Chrome
I used this and it is working!
<HTML><HEAD>
<?php if ($REQUEST_METHOD=='POST') {
$titlu = urlencode( $_POST['Keywords'] );
} elseif ($QUERY_STRING) {
$titlu = urlencode( $_GET['Keywords'] );
} else {
echo "<b>Missing XML Query — Use form (POST) or querystring (GET)</b>"; exit;
}
$titlu = str_replace("-", " ", $titlu);
$titlu = str_replace("+", " ", $titlu);
?>
<TITLE><?php echo $titlu ;?></TITLE>
But I have a problem. When I make rewrite rules using:
Options +FollowSymLinks
RewriteEngine On
ReWriteRule ^search/([A-Z0-9a-z_]*) /search.php?Keywords=$1 [L]
I will transform to:
site.com/search/anykeywordhere.html
BUT BUT, the search results from site.com/search.php?Keywords=anykeywordhere is VERY very different from site.com/search/anykeywordhere.html
WHY?
Regards,
Dan
is VERY very different from site.com/search/anykeywordhere.html ==> the site is anykeywordhere.html in folder search.
They are two different sites. I don't know what you want to do with it.
Tell us what is it that you want, and I'll try to help
Michal CIbor