|
|
|
Rank: Starting Member
Groups: Registered
Joined: 5/6/2003 Posts: 3 Location: ,
|
I know I am doing something silly but I am tired and need help.
I have a drop down box and need to pass the selection to the PayPal Shopping Cart page as the name of the item. The relevant code parts are:
<select name="prodname" id="prodname">
<option selected>Flash Device</option>
<option>Dongle</option>
<option>Mouse</option>
<option>Headset</option>
</select>
And later in the Add Cart button code:
<?php
echo"<input type=\"hidden\" name=\"item_name\" value=\"".$prodname."\">";
?>
Why is the name not being passed to the PayPal cart?
Thank you in advance.
Steve
--
Steve
Hong Kong
|
|
|
|
|
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 9/16/2002 Posts: 2,960 Location: ,
|
Can we have a look at what the HTML looks like? Patrick Breitenbach PayPal, Inc. Dev Net: https://www.paypal.com/pdn
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 5/6/2003 Posts: 3 Location: ,
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by paypal_pb [br]Can we have a look at what the HTML looks like? <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
Hi Patrick,
This is the code from my test page. I hope you can shed some light on this problem, I've been stalled for 2 days now. Thanks in advance.
<html> <head> <title>PayPalTest3</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head>
<body> <form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form1" target="paypal"> <table width="600" border="1" cellspacing="5" cellpadding="5"> <tr> <td>Device:</td> <td><select name="prodname" size="1"> <option value="Flash Device" selected>Flash Device</option> <option value="Dongle">Dongle</option> <option value="Mouse">Mouse</option> <option value="Headset">Headset</option> </select> </td> </tr> <tr> <td>Number:</td> <td><input name="number" type="text" id="number" size="5" maxlength="5"></td> </tr> <tr> <td> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="add" value="1"> <input type="hidden" name="bn" value="wa_dw_3.0.4"> <input type="hidden" name="business" value="me@mysite.com"> <?php echo"<input type=\"hidden\" name=\"item_name\" value=\"".$prodname."\">"; ?> <input type="hidden" name="amount" value="39.95"> <input type="hidden" name="currency_code" value="USD"> <?php echo"<input type=\"hidden\" name=\"quantity\" value=\"".$number."\">"; ?> <input type="hidden" name="no_shipping" value="0"> <input type="hidden" name="no_note" value="0"> <input type="image" name="submit" src="http://images.paypal.com/images/sc-but-01.gif" border="0" alt="Make payments with PayPal - it's fast, free and secure!"> </td> <td> </td> </tr> </table> </form> </body> </html>
-- Steve Hong Kong
|
|
|
|
Rank: Starting Member
Groups:
Joined: 9/10/2009 Posts: 185
|
If you are trying to get $prodname for the value of item_name, why don't you just create a select menu of item_name, and skip the php?
<select name="item_name" size="1"> <option value="Flash Device" selected>Flash Device</option> <option value="Dongle">Dongle</option> <option value="Mouse">Mouse</option> <option value="Headset">Headset</option> </select>
Same with the quantity variable. Am I missing something?
Bryan
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 5/6/2003 Posts: 3 Location: ,
|
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by lunchboxpad [br]If you are trying to get $prodname for the value of item_name, why don't you just create a select menu of item_name, and skip the php?
<select name="item_name" size="1"> <option value="Flash Device" selected>Flash Device</option> <option value="Dongle">Dongle</option> <option value="Mouse">Mouse</option> <option value="Headset">Headset</option> </select>
Same with the quantity variable. Am I missing something?
Bryan <hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
Thanks Bryan. I think you're missing the fact that I feel like an idiot today! LOL! Just humour me and tell me how the input lines should look. Like this? Nothing I've tried works so far..
<input type="hidden" name="item_name" value=""> <input type="hidden" name="quantity" value="">
Thanks.
-- Steve Hong Kong
|
|
|
|
Rank: Starting Member
Groups: Registered
Joined: 7/10/2003 Posts: 13 Location: ,
|
I do all my html in my PHP pages with the print(' ');
1.) <input type="hidden" name="custom" value="'$customvalue'">
or from mysql
2.) <input type="hidden" name="custom" value="'.$myrow['customvalue'].'">
That's how I get my Item Name / Item # / Price etc...
|
|
|
|
Guest
|
YAFVision Theme by Jaben Cargman (Tiny Gecko)Powered by YAF |
YAF © 2003-2009, Yet Another Forum.NETThis page was generated in 0.403 seconds.