homepage Welcome to WebmasterWorld Guest from 23.20.91.134
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
adding structured data to database driven site
ohno




msg:4621598
 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">
<strong>
&pound;'.$row['price'].'
</strong>
</font>
';


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.

:)

 

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved