Ovako, imam ovu formu za paypal, i sada
Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target='paypal'; return ReadForm(this, true);">
Size: <br>
8 1/2 x 11<input type="radio" name="on0" value="Size: 8x11"><br>
11 x 13
<input type="radio" name="on0" value="Size: 9x13"><br>
Custom
<input type="radio" name="on0" value="Size: 11x21">
<input type="text" name="on0" size="20"><br>
<input type="hidden" name="os1" value="" />
<input type="hidden" name="on1" value="" />
<input type="hidden" name="os0" value="" />
<input type="hidden" name="baseos1" value=" " />
<input type="hidden" name="item_number" value="Image ID: <?php echo $row['image_id']; ?>">
<input type="hidden" name="basedes" value="<? echo $row["cat_title"]; echo " - "; echo $row["image_title"]; ?>" />
<input type="hidden" name="ba" value="USD">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<?
$radio = $_POST['on0'];
if ($radio == 'Size: 8x11')
{
$amount = 35.00;
}
else if ($radio == 'Size: 9x13')
{
$amount = 45.00;
}
else
{
$amount = "TBD";
}
echo $amount;
?>
<input type="hidden" name="amount" value="<? echo "$amount"; ?>">
<input type="hidden" name="item_name" value="<? echo $row["cat_title"]; echo " - "; echo $row["image_title"]; ?>">
<input type="hidden" name="business" value="<? echo $row["business_mail"];">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<p>
<input type="image" ... align="left" width="55" height="15"><br />
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="this.target='paypal'; return ReadForm(this, true);">
Size: <br>
8 1/2 x 11<input type="radio" name="on0" value="Size: 8x11"><br>
11 x 13
<input type="radio" name="on0" value="Size: 9x13"><br>
Custom
<input type="radio" name="on0" value="Size: 11x21">
<input type="text" name="on0" size="20"><br>
<input type="hidden" name="os1" value="" />
<input type="hidden" name="on1" value="" />
<input type="hidden" name="os0" value="" />
<input type="hidden" name="baseos1" value=" " />
<input type="hidden" name="item_number" value="Image ID: <?php echo $row['image_id']; ?>">
<input type="hidden" name="basedes" value="<? echo $row["cat_title"]; echo " - "; echo $row["image_title"]; ?>" />
<input type="hidden" name="ba" value="USD">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="2">
<?
$radio = $_POST['on0'];
if ($radio == 'Size: 8x11')
{
$amount = 35.00;
}
else if ($radio == 'Size: 9x13')
{
$amount = 45.00;
}
else
{
$amount = "TBD";
}
echo $amount;
?>
<input type="hidden" name="amount" value="<? echo "$amount"; ?>">
<input type="hidden" name="item_name" value="<? echo $row["cat_title"]; echo " - "; echo $row["image_title"]; ?>">
<input type="hidden" name="business" value="<? echo $row["business_mail"];">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<p>
<input type="image" ... align="left" width="55" height="15"><br />
</form>
E sad me interesuje ovo sto sam ja pokusao ocigledno ne radi jer nista nije postovano, kako da izvucem promenjivu od radio buttona prije nego sto je forma poslana pa da sacuvam tu vrijednost u promenjivu $amount da bih mogao da pay pal nahranim ovo vrednosti.
OVO SAM JA PROBAO I ZNAM da ne radi je rnije nista postovano
Code:
<?
$radio = $_POST['on0'];
if ($radio == 'Size: 8x11')
{
$amount = 35.00;
}
else if ($radio == 'Size: 9x13')
{
$amount = 45.00;
}
else
{
$amount = "TBD";
}
echo $amount;
?>
<?
$radio = $_POST['on0'];
if ($radio == 'Size: 8x11')
{
$amount = 35.00;
}
else if ($radio == 'Size: 9x13')
{
$amount = 45.00;
}
else
{
$amount = "TBD";
}
echo $amount;
?>