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.

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.

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>

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.