Jump to content

Calling PHP info in Title Meta tags


hummerton

Recommended Posts

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

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);

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.

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.