Hi All,
I have made this mod to embed products onto third party sites.
Ideally the 3rd party site will use file_get_contents or just file and read the output.
I have created a file embed.php and this is the code I have used:
Any reviews, suggestions, critiques?PHP Code:require('includes/application_top.php');
$pID = zen_db_prepare_input($_REQUEST['products_id']);
$product = $db->Execute("select * from products where products_id ='" . (int)$pID . "'");
while (!$product->EOF){
$image = "<img src='http://********.com/shop/images/";
$image .= "{$product->fields['products_image']}' width=150/>";
$url = "http://***********.com/shop/index.php?";
$url .= "main_page=product_info";
$url .= "&products_id={$product->fields['products_id']}";
$url .= "&action=add_product";
print "<form method='post' ";
print "action='$url'>\n";
print "$image\n";
print "<br />Price: $";
print sprintf("%.2f",$product->fields['products_price']);
print "<input type='hidden' name='cart_quantity' value=1>\n";
print "<input type='hidden' name='products_id' ";
print "value={$product->fields['products_id']}>\n";
print "<br /><input type='submit' name='submit' value='Buy Now!'>\n";
print "</form>";
break;
}
Thanks,
Leonard



