Forum Moderators: coopster

Message Too Old, No Replies

paypal shopping cart

         

adamnichols45

12:10 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey guys the following code works in a html file but when i include it in a php include file it does not work.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="payments@example.co.uk">
<input type="hidden" name="item_name" value="aaa">
<input type="hidden" name="item_number" value="1111">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>

any help?

[edited by: coopster at 3:35 pm (utc) on Feb. 2, 2006]
[edit reason] generalized email address [/edit]

adamnichols45

3:31 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



any body please

coopster

3:40 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What do you mean it doesn't work? It's just html, include the file and view the page -- is the form there?

adamnichols45

3:51 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes the button is there but once clicked it is not carrying the varibles over to the paypal shopping cart.

coopster

3:59 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



OK, so the include is indeed working then. You must have something else in your page causing you issues. Once the page is displayed use the browser's "View Source" option and have a look at your page to determine where your issue lies.

adamnichols45

4:50 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok i discovered that i had this in the header file.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

and then in another include on the same page i had this.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

is it possible to have this?

adamnichols45

4:51 pm on Feb 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok from messing around -

its ok to have more than 1 form on a page as long as i close it off with </form> before starting the new one yes?

cheers for your help

fjpapaleo

11:03 pm on Feb 2, 2006 (gmt 0)

10+ Year Member



You're not using any php in the form. Have you tried closing out your php code before the form and than re-opening it after?
If you want to use php in your form it needs to be done something like this:
<?php
print " <form target=\"paypal\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
print " <input type=\"hidden\" name=\"item_name\" value=\"" . $variable . "\">";
print " </form>";
?>

adamnichols45

6:10 pm on Feb 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it was just the form tag i needed to close and then open up again once i needed a new button.