I am setting the title for a drupal site of mine with the following script:
<?php
drupal_set_title($_GET['Foo1'].' '.$_GET['Foo2'].' '.$_GET['Foo3']);
?>
that's working just fine... but I want to include some additional text in the title like this:
"search.php?Foo1=Bar1&Foo2=Bar2&Foo3=Bar3" ... title would be "Bar1 Bar2 Bar3 TEXT"
How can I insert additional text into this output? Can I put an echo in here somehow?
Dynamic page title based on URL variables?
Moderator: General Moderators
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
Code: Select all
$title =$_GET['Foo1'].' '.$_GET['Foo2'].' '.$_GET['Foo3']."some of your own text";
echo $title;Code: Select all
<?php
$title = (isset($_GET['foo']) ? htmlentities($_GET['foo']) : '');
?>
<html>
<head>
<title>
<?php echo $title; ?>
</title>
</head>
etc..