Ghostcart - Hosted PHP Shopping Cart

Code for an embedded GhostCart that recieves product input from remote site using Add to Cart method

 

Code will be coming from a page with a link somethin like this:

<a href='__PAGE_THAT_CONTAINS_THE_GHOSTCART_IFRAME.php?isolated_product=5623&product_name=<h3>No2 Energy</h3>&price=49.99&shipping_p_table=' title='Order Now'><button class='addtocart'>Add To Cart</button></a>

Step 1:

Put this code at the top of the page with the GhostCart Iframe:

<?php
// Start the session
session_start();

if (!isset($_SESSION['external_session_number'])) {
$random = rand(500,20000);
$string_raw=$_SERVER['REMOTE_ADDR'];
$string=str_replace(".","",$string_raw);
$external_session=20150528135849+$string+$random;

$_SESSION['external_session_number']=$external_session;
} else {
$external_session = $_SESSION['external_session_number'];
}
//echo"<br />$external_session<br />";

?>

Step 2:

Iframe Code:

<iframe name='the_iframe' src='https://www.ghostcart.com/cart/external_pass_to_cart.php?store_name=apexmulti&isolated_product<? $isolated_product=$_REQUEST['isolated_product']; echo $isolated_product; ?>&category=&pid=<? echo $isolated_product; ?>&id=<? echo $isolated_product; ?>&cont_shop_link=&product_name=<? $product_name=$_REQUEST['product_name']; echo $product_name; ?>&each_price=<? $price=$_REQUEST['price']; echo $price; ?>&quantity=<? if ($isolated_product>0){$quantity=1;}else{$quantity=0;} echo $quantity; ?>&shipping_p_table=<? $shipping_p_table=$_REQUEST['shipping_p_table']; echo $shipping_p_table; ?>&action=add&lastname=&firstname=&email=&address1=&city=&state=&zip=&phone=&cont_shop_url=***URL FOR THE ORIGINATING PAGE ASSUMING YOU WANT PEOPLE TO GO BACK THRE TO CONTINUE SHOPPING***&external_session_id=<? echo $external_session; ?>' width='850' height='1500' scrolling='Yes' allowtransparency='true' frameborder='0'>
<div align='center'>If you can see this, your browser doesn't understand iFRAME technology. Please make sure your browser is up to date.<br />
Refer to this<a href='pages/help.html' target='blank'> Help Page </a> for more details. </div>
</iframe>