Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to call PHP info in Title Meta tags
Old 07-03-2010, 02:33 PM How to call PHP info in Title Meta tags
Junior Talker

Posts: 1
Name: Rob
Trades: 0
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).

The page is doen in PHP and calls header.php, common.php, store-rating.php and footer.php... in case that matters.

My title coding looks like this:
Code:
<title>URL-Here.com - Save up to <?=$fetch_arr['cashback']?> when you shop 
at <?=$website[0]?></title>
I am getting the PHP right from a page that shows:
Code:
<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>
BUT, it is not displaying how I'd like it to. Any ideas?

Thanks,

Rob
hummerton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-03-2010, 03:08 PM Re: How to call PHP info in Title Meta tags
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Whats with the = symbol?

Also try to use <?php not <?

have you tried
<?php echo"$website[0]"; ?> Rather than
<?=$website[0]?>


Dont forget inline php will still need semi colons to end lines;
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 07-03-2010, 03:22 PM Re: How to call PHP info in Title Meta tags
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
@lynxus The = is a shortcut to print()

@hummertom My guess is that the $website variable is initialized later in your page.
Try to find where it's done, and use the same code for your print.
Example:
PHP Code:
<?php
//... stuff here
$website=$_SERVER['HTTP_HOST']
//...more stuff
Then in your header use
PHP Code:
<?php
$website
=$_SERVER['HTTP_HOST']
?>
<title>URL-Here.com - Save up to <?=$fetch_arr['cashback']?> when you shop 
at <?=$website[0]?></title>
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 07-03-2010, 04:34 PM Re: How to call PHP info in Title Meta tags
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Quote:
Originally Posted by tripy View Post
@lynxus The = is a shortcut to print()
The more you know aye
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Reply     « Reply to How to call PHP info in Title Meta tags
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.04292 seconds with 12 queries