Welcome to WikiSoftPeople.com the one stop for all of your Web needs. We specialize in Web Design, Search Engine Optimization, PHP programming, Email Pipe Scripting, Google Maps Integrations, VoIP Integrations, Domain Space, Server Space, Domain Names, Web Hosting and much more. Our Motto is if you can dream it we can do it!

How to add php variables to paypal buttons

| No Comments | No TrackBacks

WikiSoftBlog


After extensive searching on this topic I have uncovered the easiest way to send customizable invoices through email generated with PHP variables.

If you are trying to do something similar to this you may have thought it would be easier than it actually was. Paypal will have you think that you need to add an item through their interface for every item you want a button for.

In actuality you can simply past this code

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value=youremail@youremail.com>
<input type="hidden" name="item_name" value="DryCleaning">
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="<?php echo $current; ?>">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.yoursite.com/returnpage.php">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but02.gif" border="0" name="submit" alt="Make your payments with PayPal. It is free, secure, effective.">
<img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>

 

Notice how I did the php echo of the price variable? That's the trick...

Now you may also be asking how do you put this in an email?

Well you don't put this in an email because emails first off vary and there is no platform between gmail, yahoo mail, outlook, thunderbird, etc.. etc.. etc.... not to mention some browsers or users refuse to view email using html for spam reasons.

So we need them to go back to their browser. So simply take the price that you wanted them to pay that was sent to the email and create and echo the variables you want into a link in their email.

Then use GET commands to pull that information and create the button from the code we made above.

if you are unfamilar with get variables there is a good tutorial on them here : http://www.w3schools.com/PHP/php_get.asp

Let me know if you have any questions.

 

Thanks,

Matt

No TrackBacks

TrackBack URL: http://www.wikisoftpeople.com/cgi-bin/mt-tb.cgi/28

Leave a comment

  • aNyhed
  • Digg it!
  • Add to Del.Icio.Us
  • Add to Technorati
  • Stumble It!
  • NewsVine
  • Furl
  • Slashdot
  • Google Bookmarks
  • YahooMyWeb
  • Yahoo Bookmarks
  • MySpace
  • Propeller
  • myAOL
  • Faves
  • Ask Jeeves
  • Mr. Wong
  • Live
  • Facebook
  • Facebook
  • Blink It
  • Mixx
  • Diigo
  • Backflip
  • Add "How to add php variables to paypal buttons " to Blogmarks
  • Add this post to Ma.gnolia
  • Add this post to Reddit
  • Simpy
  • Spurl
  • Thoof it
  • BUMPzee

About this Entry

This page contains a single entry by wikisoftpeople published on December 7, 2009 2:41 PM.

Another Dealer Locator Installed was the previous entry in this blog.

Is now working with rollovermonkey.com is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.