How to make title tag dynamic

  • lucky
  • Graduate
  • Graduate
  • User avatar
  • Posts: 117

Post 3+ Months Ago

hello all,
i have recently made a new site, http://www.ilumu.com/
but when searches are made, i wish to make the title tag dynamic on results page.
i.e. if someone searched for "Eagle Eye The Movie", i want the title attribute/element to be that.
i am using google custom search btw, and here is some of the code:

<input type="hidden" name="cx" value="001544763053804352714:6zdzmc81oma" />
<input type="hidden" name="cof" value="FORID:11" />

<input type="hidden" name="ie" value="UTF-8" />
<input type="text" name="q" size="51" />
<input type="submit" name="sa" value="Search" />


please help!
thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

In your "search.php" add this in-between your <title></title> tags.

Code: [ Select ]
<?php echo str_replace(array('<','>'), '', urldecode($_GET['q'])); ?>
  • lucky
  • Graduate
  • Graduate
  • User avatar
  • Posts: 117

Post 3+ Months Ago

absolute awesomeness!
works like a dream,
thanks! :D
is there a way to make the first letter of each word capitals?

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 88 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.