ok everybody, here is how i made paypal + php + mysql work.
1) setup your mysql database with all the information your going to need. you need a few basic items, a product id # and a quanity availble column. the rest is up to you..
2) you need a web page that has some kind of products on it. your going to need to instert the follow code onto the page to create some hidden fields to pass important variables:
<input type="hidden" name="directory" value="nymph">
<input type="hidden" name="inventory" value="1">
the value of directory is used to direct where you want the person to go to find the add to cart page. the inventory value is set to the item number of the product.
3) this is where it gets kinda sloppy and im sure there is a better way to do this. make a script called inventory.php (or what ever) basicly this script is going to simply check your databases quanity available field and see if its equal to 0 or not. if its equal to zero then it redirects you to a page that says your out of that item. if its not equal to zero it redirects you to a page where you can actually order the item. here is the code for such a script (as i use):
<?php
$db = mysql_connect("my_db", "my_user");
mysql_select_db("db_name",$db);
$result = mysql_query("SELECT * FROM db_table ",$db);
$dir = $directory;
$id = $inventory;
$image = mysql_result($result,$id,"image");
$name = mysql_result($result,$id,"product name");
$description = mysql_result($result,$id,"product description");
$producer = mysql_result($result,$id,"producer");
$stars = mysql_result($result,$id,"stars");
$length = mysql_result($result,$id,"length");
$stock = mysql_result($result,$id,"in stock");
$price = mysql_result($result,$id,"price");
if ($stock == 0) {
header("Location: noproduct.htm");
}
else {
header("Location: $directory/id.htm");
}
?>
4) ok let me explain what ive done here, i made a connection to the db, got everything from the db (you dont really need to do this, i just did it cause it was a cut and paste job)basicly this script checks your db as i mentioned above, the output of a positive ammount of inventory takes you to a page called $directory/$id.htm. the $directory is used to place the product in a dir with similar products. i used the products id number to create an html file in the directory of similar products.
5) next you need to make a template for the $id.htm page. this is pretty easy, all your template page needs is the link to your free paypal provided shopping cart.
if this doesnt make sence, see it in action at www.chickenstock.org/sds/producers/nymph.php im working on converting my whole site over to this system. im sure there is a better easier way to do this, but this works for me. if you would like a better explination, please email me, and ill do my best to make it make sence. i know alot of people want to make this work..