NameSilo

Simple Paypal Order Form

Spaceship Spaceship
Watch
Hello everyone :wave:

I am not much of a PHP coder but I know some, so I decided to put toghether a small script for people selling items who are tired of making a subscription page for each item! This way you create the url, put it on your site and the payment is sent to you! Nifty, huh?

Here it goes,
Code:
<?php
// Time for item information
$Item=$_GET['Item'];
$Price=$_GET['Price'];
$Currency=$_GET['Currency'];
$Shipping=$_GET['Shipping'];
$Time=$_GET['Time'];
// Time for the sellers information
$PaypalEmail=$_GET['PaypalEmail'];
$CompanyName=$_GET['CompanyName'];
$WebsiteURL=$_GET['WebsiteURL'];


?>
Thank you for choosing to purchase from <a href="<?php echo "$WebsiteURL"; ?>"><?php echo "$CompanyName"; ?></a>

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="<?php echo "$PaypalEmail"; ?>">
<input type="hidden" name="currency_code" value="<?php echo "$Currency"; ?>">
<input type="hidden" name="no_shipping" value="<?php echo "$Shipping"; ?>">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="<?php echo "$Price"; ?>">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="<?php echo "$Time"; ?>">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>

Now this is what you do,

1) Put all this code into paypal.php (or what ever page you want, make sure your website supports PHP and you have it ending in a .php extention)
2) Here is the tricky part, making the url.

Here is a example of what the url will look like,

http://www.mydomain.com/paypal.php?Item=Hosting&Price=5.00&Currency=USD&Shipping=0&Time=M&PaypalEmail=[email protected]&CompanyName=YourCompany&WebsiteURL=http://www.yourdomain.com

Ok so,

Item - Shows what's the items name, for example: Hosting Plan Basic
Price - This is pretty explanitory, do not include the $, this comes in on the currency part
Currency - Put the Currency you want to accept
Shipping- Leave to 0 if no shipping, or put too 1 if there is shipping included
Time - This is the recuring payment part, put M for montly, Y for yearly, etc
PaypalEmail - This is your paypal email
CompanyName - Self Explanitory
WebsiteURL - Self Explanitory

The whole script is basically self explanitory, but I made it as simple as I could for the new end user to paypal subscriptions.

If you like the script, rep is appreciated :)

Thanks,
Camron
 
3
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hmm, I might find a few uses for this.

Edit: Do you think you could make a front end for this. Especially one that does not show the price and etc. that someone could change.
 
Last edited:
0
•••
Thanks
Rep Added
 
0
•••
What about notification that wether or not the payment was succesful?? You should add another script that verifies wether or not the payment was succesfull.
 
0
•••
Like I said this is very basic. You will get an email from paypal saying the money has been sent. This is a tutorial, and is VERY basic (when I mean basic I mean this is the mother of all basic scripts).
 
0
•••
ablaye, that would be a paypal ipn script and that is not what this is. Nice script :)
 
0
•••
0
•••
0
•••
beaver6813 said:
Heh, looking at that it might just be easier to use a paypal button generator for payment :p
What's that?
 
0
•••
mtorregiani said:
What's that?
Basically the same as this, but it used javascript to do all the stuff that the page Camron created does. Meant less coding :p Don't get me wrong though, i like this script :D
 
0
•••
I did this so you can have multiple items on one page, instead of making a paypal page for each item you are selling.
 
0
•••
Camron,
Great work :tu:

I was actually looking for one of these today, and I find it right here close to home!

Thank you!

-Allan :gl:
 
0
•••
Thanks Allan, I am currently working on a mysql version (php paypal shopping cart).

Thanks,
Camron
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back