YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Passing an item name from a list Options
Steve Fleischer
#1 Posted : Wednesday, May 07, 2003 2:07:44 AM
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
Sponsor  
 
paypal_pb
#2 Posted : Wednesday, May 07, 2003 1:28:55 PM
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
Steve Fleischer
#3 Posted : Wednesday, May 07, 2003 1:36:04 PM
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.

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;PayPalTest3&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="form1" target="paypal"&gt;
&lt;table width="600" border="1" cellspacing="5" cellpadding="5"&gt;
&lt;tr&gt;
&lt;td&gt;Device:&lt;/td&gt;
&lt;td&gt;&lt;select name="prodname" size="1"&gt;
&lt;option value="Flash Device" selected&gt;Flash Device&lt;/option&gt;
&lt;option value="Dongle"&gt;Dongle&lt;/option&gt;
&lt;option value="Mouse"&gt;Mouse&lt;/option&gt;
&lt;option value="Headset"&gt;Headset&lt;/option&gt;
&lt;/select&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Number:&lt;/td&gt;
&lt;td&gt;&lt;input name="number" type="text" id="number" size="5" maxlength="5"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;input type="hidden" name="cmd" value="_cart"&gt;
&lt;input type="hidden" name="add" value="1"&gt;
&lt;input type="hidden" name="bn" value="wa_dw_3.0.4"&gt;
&lt;input type="hidden" name="business" value="me@mysite.com"&gt;
&lt;?php echo"&lt;input type=\"hidden\" name=\"item_name\" value=\"".$prodname."\"&gt;"; ?&gt;
&lt;input type="hidden" name="amount" value="39.95"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;?php echo"&lt;input type=\"hidden\" name=\"quantity\" value=\"".$number."\"&gt;"; ?&gt;
&lt;input type="hidden" name="no_shipping" value="0"&gt;
&lt;input type="hidden" name="no_note" value="0"&gt;
&lt;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!"&gt;
&lt;/td&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

--
Steve
Hong Kong
deleted user: 240
#4 Posted : Wednesday, May 07, 2003 2:48:08 PM
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?

&lt;select name="item_name" size="1"&gt;
&lt;option value="Flash Device" selected&gt;Flash Device&lt;/option&gt;
&lt;option value="Dongle"&gt;Dongle&lt;/option&gt;
&lt;option value="Mouse"&gt;Mouse&lt;/option&gt;
&lt;option value="Headset"&gt;Headset&lt;/option&gt;
&lt;/select&gt;

Same with the quantity variable. Am I missing something?

Bryan
Steve Fleischer
#5 Posted : Wednesday, May 07, 2003 3:27:17 PM
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?

&lt;select name="item_name" size="1"&gt;
&lt;option value="Flash Device" selected&gt;Flash Device&lt;/option&gt;
&lt;option value="Dongle"&gt;Dongle&lt;/option&gt;
&lt;option value="Mouse"&gt;Mouse&lt;/option&gt;
&lt;option value="Headset"&gt;Headset&lt;/option&gt;
&lt;/select&gt;

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..

&lt;input type="hidden" name="item_name" value=""&gt;
&lt;input type="hidden" name="quantity" value=""&gt;

Thanks.

--
Steve
Hong Kong
toddw
#6 Posted : Thursday, July 10, 2003 10:36:02 PM
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.) &lt;input type="hidden" name="custom" value="'$customvalue'"&gt;

or from mysql

2.) &lt;input type="hidden" name="custom" value="'.$myrow['customvalue'].'"&gt;

That's how I get my Item Name / Item # / Price etc...
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.403 seconds.