tags:

views:

48

answers:

4

how pass multiple values to paypal .i used it in paypal submission page

<input type="hidden" name="custom" value="id_cart={$id_cart}&option={option}" />

i get

$_POST['custom'] = id_cart=534&option=1620850004 , 

how i get it seperately like

 $_POST['id_cart'] =534 , $_POST['option'] =1620850004.
A: 

Assuming those values are stored in $id_cart and $option AND you really want a querystring-like parameter in your hidden field:

<input type="hidden" name="custom" value="custom={$id_cart}&option={$option}" />
ThiefMaster
there is no error displayed , the page is not displaying
hwd
you are right, what will be the correct form
hwd
can you see your page when you not enter any value in hidden field?
Salil
ya i can see the page, but i put this code then the page is not displaying
hwd
A: 
VAC-Prabhu
i tried but the same....
hwd
A: 

Can you please change the hidden control's name...? because the value which posted like "custom=" and the name is also have "custom"

so there may be some conjunctions..please change that and let ma know.

VAC-Prabhu
hwd
A: 

The name attribute on your form fields will become the key server-side, simply break your current hidden field up with new names:

You should also be escaping the values on the page, I'm assuming you're using smarty...


<input type="hidden" name="id_cart" value="{$id_cart|htmspecialchars}" />
<input type="hidden" name="option" value="{$option|htmspecialchars}" />

If you want / need to keep your HTML the same, you can split the values on the server-side with parse_str:


$r = array();
parse_str($_POST['custom'], $r);

print $r['id_cart'];
print $r['option'];

mmattax