Jump to content

[SOLVED] Help needed with dynamic title tags


pixelhouse

Recommended Posts

Hi, I've got a site http://www.weddingshoeshop.co.uk/product_detail_wedding.php?pid=120 which I would like to have dynamically set the title tags dependant on a field contained within the page (namely the shoe name).  In the code for the page  <?=$rs_prod['p_name']?> is used to display the product name.

 

Any advice would be greatly appreciated.

Link to comment
Share on other sites

Hi, thanks for the suggestion, however I've tried <? $p_name ?> and no joy, http://www.weddingshoeshop.co.uk/product_detail_wedding.php?pid=29 should show "WalkRite DyeRite Wedding Shoes - Product Detail : BLUSH" in as the title, when I use the <title>WalkRite DyeRite Wedding Shoes - Product Detail : <? $p_name ?></title>

 

I assume I'm correct using <? $p_name ?> when the code to call the name in the page itself is <?=$rs_prod['p_name']?>

 

I'm relatively new to php so all help appreciated.

Link to comment
Share on other sites

Okay, it's normal,

you can't use $p_name in the title, because it hasn't any value on that moment

later in the page it get's his value from rs_prod['p_name']

 

You should be able to solve this by using this:

<title>WalkRite DyeRite Wedding Shoes - Product Detail : <? print $rs_prod['p_name']; ?></title>

 

instead of

<title>WalkRite DyeRite Wedding Shoes - Product Detail : <? print $p_name; ?></title>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.