Hello, I have standard Paypal "Add to Cart" buttons. I don't have a shopping cart on my site I use the Paypal shopping cart. I'd like to track when a user clicks on the "Add to Cart" and save that info to a database. I'm proficient at ASP coding but not sure how to handle this. I was thinking about sending form fields to another asp page, updating the db, then create another form in code and submit to paypal. I don't know if it's possible to submit a form in code on the server. Any suggestions are appreciated!
First of all what exactly do you want to save in the DB? Also, have a client side script which enables the clicking of the button only once!
I would use client-side javascript like this: <script type="text/javascript"> var xmlDoc; function recordClick(xmlFile) { xmlDoc.async="false"; xmlDoc.load(xmlFile); return true; } </script> Code (markup): Then in the onclick event of the button have this: onclick="recordClick('addclick.asp');" The addclick.asp file would have code that would add the click to the database (assuming that you mean you want to count the amount of clicks to the button). I haven't tested this code, it might need fine tuning. Problem is I think this code will only work in IE... but other browsers may have a similar feature which can be implemented. You could also extend this to count the clicks of multiple buttons or links... e.g: onclick="recordClick('addclick.asp?id=3');"