hummerton Posted July 3, 2010 Share Posted July 3, 2010 Hello all I have been messing with this for almost 2 days now... hate it when I can't figure out something... hurts my ego I have a website that I am trying to make the TITLE meta tag read the specific store and cash back offered (There are about 700 stores). My title coding looks like this: <title>URL-Here.com - Save up to <?=$fetch_arr['cashback']?> when you shop at <?=$website[0]?></title> I am getting the PHP right from the page that shows: <tr> <td colspan="2" align="left">Use URL-Here.com every time you shop online at <a href="<?=$user_link?>" target=_blank style="text-decoration:underline"><b><?=$website[0]?></b></a> to earn a <?=$fetch_arr['cashback']?> cash back discount. </td> </tr> I can't see what I am doing wrong. Any ideas? Thanks, Rob Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/ Share on other sites More sharing options...
Pikachu2000 Posted July 3, 2010 Share Posted July 3, 2010 Get rid of the quick echo "<?=' tag syntax; it will comeback to haunt you. Change to long open tags <?php echo $fetch_arr['cashback']; ?> Also, make sure $fetch_arr['cashback'] has a value with print_r($fetch_arr); Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080705 Share on other sites More sharing options...
hummerton Posted July 3, 2010 Author Share Posted July 3, 2010 I changed to the below listed code, but still no luck. What do you mean by print? <title>ShopItBack.com - Save up to <?php echo $fetch_arr['cashback']; ?> when you shop at <?php echo $website; ?></title> Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080709 Share on other sites More sharing options...
Pikachu2000 Posted July 3, 2010 Share Posted July 3, 2010 If you put the following: print_r($fetch_arr); on a line in the code, it will echo all the elements of the $fetch_arr array, so you can see what has a value assigned, if anything. Should probably go outside of the <head></head> tag, though. Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080714 Share on other sites More sharing options...
kenrbnsn Posted July 3, 2010 Share Posted July 3, 2010 Is the file where this line is located a PHP file or a HTML file. It must be a PHP file. Ken Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080722 Share on other sites More sharing options...
hummerton Posted July 3, 2010 Author Share Posted July 3, 2010 Yes, a PHP file. Don't know much about the print_r($fetch_arr); thing... will read up a little on it. Thanks, Rob Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080730 Share on other sites More sharing options...
kenrbnsn Posted July 3, 2010 Share Posted July 3, 2010 Can you post more code? That may help us determine the problem. Ken Link to comment https://forums.phpfreaks.com/topic/206633-calling-php-info-in-title-meta-tags/#findComment-1080732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.