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
Dynamic page title help please?
Old 07-25-2011, 12:44 PM Dynamic page title help please?
Junior Talker

Posts: 2
Trades: 0
I have a php site that I would like to apply dynamic page titles to. I have the variables existing and used on that same page already, but when I try to add them to the page title it stays blank when Iuse:

<?php echo $t->user->name ?>


or also;

<?php echo $Searcher->getUserLink($t->user->screen_name,$t->user->name,$categoryID)?>"><?php echo $t->user->name ?>

The same instructions are working where the code currently is further down the page, can anyone help me to use this to create dynamically changing page titles please? As you can probably tell Im no php expert but can follow instructions to some degree

Thankyou
cardpark is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-25-2011, 03:04 PM Re: Dynamic page title help please?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If they are working further on in the page, the variables are being initiated AFTER you try to use them for the title.

Move the code that sets the variable before the title code.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-26-2011, 04:43 AM Re: Dynamic page title help please?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Read it four times now and still have no idea what it means!!
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-28-2011, 11:33 AM Re: Dynamic page title help please?
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
I think what he's trying to say is to make sure that $t is set.

Solution: Move ALL the code that doesn't echo anything and that sets variables above the DOCTYPE, or at least right before the <title> tag. This will ensure that the variables are properly set, and if it still doesn't work, there's something wrong with the PHP code itself.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-01-2011, 08:57 AM Re: Dynamic page title help please?
Junior Talker

Posts: 2
Trades: 0
Thankyou for the responses, I did actually guess that the variable wasnt being set before it was called, and tried moving some code, but it didnt help.

Ill give it another go, I probably didnt move it correctly. Thanks though
cardpark is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Dynamic page title help please?
 

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 0.26249 seconds with 12 queries