Welcome to WebmasterWorld Guest from

Forum Moderators: open

adding structured data to database driven site

4:16 pm on Nov 6, 2013 (gmt 0)

We have a custom written cart (something I now wish we hadn't done!). I've been looking into adding structured data tags to the site, the prices, product code & availability are all database driven, we paste a line of javascript into the HTML webpage to make these items "appear". I've looked at the data file the info seems to come from, an example below :-

//Displays the ex VAT price of a product. Requires product ID
$sql = "SELECT price FROM products WHERE productid='".mysql_real_escape_string($_GET['id'])."'";
$result = mysql_query($sql);
while ( $row = @mysql_fetch_array($result, MYSQL_BOTH) )
$data .= '
<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#990033">

I thought I may be able to add the tags in there to make site wide tagging easy, no such luck! Does anyone know if it is possible to add the schema tags to the data file to do this? I can't add the tag to the actual webpage as the price info for example isn't shown-just the line of JS like :-

<script type="text/javascript" src="https://www.domain.com/data.php?info=16&id=213"></script>

Which then shows as the price in a browser but the HTML source shows the above line. Any help would be great.


Featured Threads

Hot Threads This Week

Hot Threads This Month