Ok, that makes sense but we have thousands of products on the site so I would have to change all of the buy buttons?
Surely you have a database and only 2 files to edit.
The product detail page where you can edit the add to basket button.
Displaying a list of products is done with a loop. Simply edit the contents of the loop to include a form for each product. Please tell me you have not hand coded each product add to basket button.
Also if you are trying to redirect the user back to the referring page you should not be passing the script name through the url as a parameter. You should implement a tracker that stores the url in a session on each page load. You can then use this to redirect a user. This method could then be used to track users throughout your site. I would want to know what direction a user took on my site to buy a product, i.e which pages are performing best also if a users tracking stops at the product info screen then I may think about updaing it a little, maybe the photos are no good or the product information is poor. This is essential information with online shops.