SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    sweden
    Posts
    646
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Changing a PayPal form button to code?

    This is probably a very simple question for people here.

    I have a PayPal button, that changes depending on different things on a web site.
    The code I have from PayPal is echoed on my page as a form with the code included for the correct amount.

    Now I would like this code to happen on another page.
    When a user is clicking on a link I have called PAY, they should end up at a page called pay.php

    In this page I want the PayPal action to happen. So, I just want to get rid of the form codes and the image and make that part as a header or whatever to send the user to PayPal with the correct code included. But I'm not sure how to do it.

    I have to change this for security reasons and make it on a separate page.

    This is what the code looks like:

    PHP Code:
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
    <
    input type="hidden" name="cmd" value="_s-xclick">
    <
    input type="hidden" name="hosted_button_id" value="unique code">
    <
    input type="image" src="http://website.com/pay.jpg" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <
    img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </
    form

  2. #2
    SitePoint Guru
    Join Date
    Nov 2004
    Location
    sweden
    Posts
    646
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Or is it possible to add the unique code to an URL?

    Could the URL be like this to work?
    PHP Code:
    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&&hosted_button_id=unique code 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •