Jump to content

changing the title using multiple isset


sphinx

Recommended Posts

im trying to get a different title when links like:

 

site.com/?off, and site.com/?off1 display the same title, but  ?on displays a diff title however, it doesnt seem to work properly, im using the code below:

 

<?php
if ((isset($_GET['off'])) && (isset($_GET['off1'])))  
echo "<title>Url - Statistics</title>"
?>
<?php
$link ='hits.php?on';
if (isset($_GET['on']))
echo "<title>Url - Statistics - Auto refreshing.....</title>"
?>

 

 

thanks

 

when i type site.com/?off into my browser, no title is displayed

Link to comment
https://forums.phpfreaks.com/topic/216272-changing-the-title-using-multiple-isset/
Share on other sites

For starters, you have a logical problem with that code. If the URL ends up as hits.php?off=&off1=&on=, 2 title tags end up in the html. You need to use if/elseif/else syntax or switch statements.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.