Using Flash buttons ....
If you are creating buttons by hand and you want to use Flash MX, you can easily create single item purchase buttons, add to cart buttons and view cart buttons.
Single item purchase buttons
Both of the following will post the required data.
1. Creating a buy button as part of the main time line
For a button called 'buy_btn2' :
//***************************************************buy_btn2.onRelease = function() {
item_number = "item2";
getURL("http://www.yourservername.com/ipnmonitor/ipn/process.php", "_self", "POST");
};
// the url is http://www.yourservername.com/ipnmonitor/ipn/process.php
//assuming that you have installed PHP-IPNMonitor at the
//root of your web site in a folder called 'ipnmonitor'.
// The "item2" value is the item_number for the product you
// wish to create the button for. This is the value that you
// gave the item in the Products display of the PHP-IPNMonitor
// admin pages.
//***************************************************
2. Creating a buy button linked to the button code
//***************************************************on (release) {
item_number = "item1";
getURL("http://www.yourservername.com/ipnmonitor/ipn/process.php", "_self", "POST");
};
// the url is http://www.yourservername.com/ipnmonitor/ipn/process.php
// assuming that you have installed PHP-IPNMonitor at the root
// of your web site in a folder called 'ipnmonitor'.
// The "item1" value is the item_number for the product you wish
// to create the button for. This is the value that you gave
// the item in the Products display of the admin pages.
Clicking on a buy now button will all that item to be purchased from PayPal.
Add to cart buttons
For an add to cart button called 'add_to_cart_1' :
//***************************************************add_to_cart_1.onRelease = function() {
item_number = "item1";
action = "add";
from = "http://www.yourservername.com/page.php";
getURL("http://www.yourservername.com/ipnmonitor/cart/viewcart.php", "_self", "POST");
};
// the url is http://www.yourservername.com/ipnmonitor/cart/viewcart.php
// assuming that you have installed PHP-IPNMonitor at the root
// of your web site in a folder called 'ipnmonitor'.
// The "item1" value is the item_number for the product you wish
// to create the button for. This is the value that you gave
// the item in the Products display of the admin pages.
// The 'from' url is the url that the button is on to identify where
// the button came from.
Clicking on the add to cart button will take you to the viewcart.php page and add the appropriate item number to the cart.
View cart button
For a view cart button :
//***************************************************view_cart.onRelease = function() {
from = "http://www.yourservername.com/page.php";
getURL("http://www.yourservername.com/ipnmonitor/cart/viewcart.php", "_self", "POST");
};
// the url is http://www.yourservername.com/ipnmonitor/cart/viewcart.php
// assuming that you have installed PHP-IPNMonitor at the root
// of your web site in a folder called 'ipnmonitor'.
// The 'from' url is the url that the button is on to identify where
// the button came from.
Clicking on the 'view cart' button will take you to the viewcart.php page.
The above example can be downloaded by clicking here.

