I have used the following code for submitting the values to paypal. but it is not working for firefox. Please give me a suggestion.
[code=php]
// implied -- pbmods
echo '
<script language="javas cript">
document.write( "<form name=\"main_for m1\" method=\"post\" action=\"'.PAYP AL_URL.'\">");
document.write( "<input type=\"hidden\" name=\"cmd\" value=\"_cart\" >");
document.write( "<input type=\"hidden\" name=\"upload\" value=\"1\">");
document.write( "<input type=\"hidden\" name=\"business \" value=\"'.$payp al_id.'\">");
document.write( "<input type=\"hidden\" name=\"no_shipp ing\" value=\"1\">");
document.write( "<input type=\"hidden\" name=\"currency _code\" value=\"USD\">" );
document.write( "<input type=\"hidden\" name=\"return\" value=\"'.NOTIF Y_URL_SHOPPING. '\">");
document.write( "<input type=\"hidden\" name=\"rm\" value=\"2\">");
document.write( "<input type=\"hidden\" name=\"payer_id \" value=\"'.$paye r_session.'\">" );
document.write( "<input type=\"hidden\" name=\"first_na me\" value=\"'.$sfir stName.'\">");
document.write( "<input type=\"hidden\" name=\"last_nam e\" value=\"'.$slas tName.'\">");
document.write( "<input type=\"hidden\" name=\"address1 \" value=\"'.$sstr eet.'\">");
document.write( "<input type=\"hidden\" name=\"city\" value=\"'.$scit y.'\">");';
if($scountry == "1")
{ $state_for_payp al = trim($state_for _paypal);
$paypal_content .='document.wri te("<input type=\"hidden\" name=\"state\" value=\"'.$stat e_for_paypal.'\ ">");
document.write( "<input type=\"hidden\" name=\"country\ " value=\"US\">") ;';
}
else
{
$sprovince = trim($sprovince );
$paypal_content .='document.wri te("<input type=\"hidden\" name=\"state\" value=\"'.$spro vince.'\">");
document.write( "<input type=\"hidden\" name=\"country\ " value=\"CA\">") ;';
}
$paypal_content .='
document.write( "<input type=\"hidden\" name=\"zip\" value=\"'.$zipc ode.'\">");
document.write( "<input type=\"hidden\" name=\"mobile\" value=\"'.$mobi le.'\">");
document.write( "<input type=\"hidden\" name=\"email\" value=\"'.$emai l.'\">");';
$sno=1;
$shipping_cost= 0;
$totamt=0;
$select_sales_d etails = "Select S.Product_id, S.Price, S.Quantity, S.Shipping_cost , P.Product_name, P.Item_No from ".TEMP_SALE S." as S, ".PRODUCTS. " as P Where S.Order_no='$or der_no' and S.Product_id=P. Product_id";
$result_sales_d etails = mysql_query($se lect_sales_deta ils,$dbconnecti on1);
while(list($Pro duct_id,$Price, $Quantity,$Ship ping_cost,$Prod uct_name,$Item_ No)=mysql_fetch _array($result_ sales_details))
{
$paypal_content .='
document.write( "<input type=\"hidden\" name=\"item_nam e_'.$sno.'\" value=\"'.$Prod uct_name.'\">") ;
document.write( "<input type=\"hidden\" name=\"item_num ber_'.$sno.'\" value=\"'.$Item _No.'\">");
document.write( "<input type=\"hidden\" name=\"amount_' .$sno.'\" value=\"'.$Pric e.'\">");
document.write( "<input type=\"hidden\" name=\"quantity _'.$sno.'\" value=\"'.$Quan tity.'\">");
document.write( "<input type=\"hidden\" name=\"shipping _'.$sno.'\" value=\"'.$Ship ping_cost.'\">" );';
$sno++;
$totamt +=($Price*$Quan tity);
$shipping_cost += $Shipping_cost;
}
$ord_tot = $totamt;
$tax = ($ord_tot*$sale s_tax)/100;
$ord_tot = $ord_tot+$tax+$ shipping_cost;
$tax=number_for mat($tax,2,'.', '');
$shipping_cost= number_format($ shipping_cost,2 ,'.','');
$ord_tot=number _format($ord_to t,2,'.','');
$paypal_content .=
'
document.write( "<input type=\"hidden\" name=\"shipping \" value=\"'.$ship ping_cost.'\">" );
document.write( "<input type=\"hidden\" name=\"tax_cart \" value=\"'.$tax. '\">");
document.write( "<input type=\"hidden\" name=\"tot_amt\ " value=\"'.$ord_ tot.'\">");
document.write( "<input type=\"hidden\" name=\"custom\" value=\"'.$paye r_session.'~~~' .$memberid.'~~~ '.$first_name.' ~~~'.$last_name .'~~~'.$email.' ~~~'.$username. '~~~'.$time.'~~ ~'.$order_no.'~ ~~'.$store_id.' ~~~'.$tax.'\">" );
document.write( "<input type=\"hidden\" name=\"night_ph one_a\" value=\"'.$phon e1.'\">");
document.write( "<input type=\"hidden\" name=\"night_ph one_b\" value=\"'.$phon e2.'\">");
document.write( "<input type=\"hidden\" name=\"night_ph one_c\" value=\"'.$phon e3.'\">");
document.write( "</form>");
document.main_f orm1.action="'. PAYPAL_URL.'";
document.main_f orm1.submit();
</script>';
echo $paypal_content ;[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
[code=php]
// implied -- pbmods
echo '
<script language="javas cript">
document.write( "<form name=\"main_for m1\" method=\"post\" action=\"'.PAYP AL_URL.'\">");
document.write( "<input type=\"hidden\" name=\"cmd\" value=\"_cart\" >");
document.write( "<input type=\"hidden\" name=\"upload\" value=\"1\">");
document.write( "<input type=\"hidden\" name=\"business \" value=\"'.$payp al_id.'\">");
document.write( "<input type=\"hidden\" name=\"no_shipp ing\" value=\"1\">");
document.write( "<input type=\"hidden\" name=\"currency _code\" value=\"USD\">" );
document.write( "<input type=\"hidden\" name=\"return\" value=\"'.NOTIF Y_URL_SHOPPING. '\">");
document.write( "<input type=\"hidden\" name=\"rm\" value=\"2\">");
document.write( "<input type=\"hidden\" name=\"payer_id \" value=\"'.$paye r_session.'\">" );
document.write( "<input type=\"hidden\" name=\"first_na me\" value=\"'.$sfir stName.'\">");
document.write( "<input type=\"hidden\" name=\"last_nam e\" value=\"'.$slas tName.'\">");
document.write( "<input type=\"hidden\" name=\"address1 \" value=\"'.$sstr eet.'\">");
document.write( "<input type=\"hidden\" name=\"city\" value=\"'.$scit y.'\">");';
if($scountry == "1")
{ $state_for_payp al = trim($state_for _paypal);
$paypal_content .='document.wri te("<input type=\"hidden\" name=\"state\" value=\"'.$stat e_for_paypal.'\ ">");
document.write( "<input type=\"hidden\" name=\"country\ " value=\"US\">") ;';
}
else
{
$sprovince = trim($sprovince );
$paypal_content .='document.wri te("<input type=\"hidden\" name=\"state\" value=\"'.$spro vince.'\">");
document.write( "<input type=\"hidden\" name=\"country\ " value=\"CA\">") ;';
}
$paypal_content .='
document.write( "<input type=\"hidden\" name=\"zip\" value=\"'.$zipc ode.'\">");
document.write( "<input type=\"hidden\" name=\"mobile\" value=\"'.$mobi le.'\">");
document.write( "<input type=\"hidden\" name=\"email\" value=\"'.$emai l.'\">");';
$sno=1;
$shipping_cost= 0;
$totamt=0;
$select_sales_d etails = "Select S.Product_id, S.Price, S.Quantity, S.Shipping_cost , P.Product_name, P.Item_No from ".TEMP_SALE S." as S, ".PRODUCTS. " as P Where S.Order_no='$or der_no' and S.Product_id=P. Product_id";
$result_sales_d etails = mysql_query($se lect_sales_deta ils,$dbconnecti on1);
while(list($Pro duct_id,$Price, $Quantity,$Ship ping_cost,$Prod uct_name,$Item_ No)=mysql_fetch _array($result_ sales_details))
{
$paypal_content .='
document.write( "<input type=\"hidden\" name=\"item_nam e_'.$sno.'\" value=\"'.$Prod uct_name.'\">") ;
document.write( "<input type=\"hidden\" name=\"item_num ber_'.$sno.'\" value=\"'.$Item _No.'\">");
document.write( "<input type=\"hidden\" name=\"amount_' .$sno.'\" value=\"'.$Pric e.'\">");
document.write( "<input type=\"hidden\" name=\"quantity _'.$sno.'\" value=\"'.$Quan tity.'\">");
document.write( "<input type=\"hidden\" name=\"shipping _'.$sno.'\" value=\"'.$Ship ping_cost.'\">" );';
$sno++;
$totamt +=($Price*$Quan tity);
$shipping_cost += $Shipping_cost;
}
$ord_tot = $totamt;
$tax = ($ord_tot*$sale s_tax)/100;
$ord_tot = $ord_tot+$tax+$ shipping_cost;
$tax=number_for mat($tax,2,'.', '');
$shipping_cost= number_format($ shipping_cost,2 ,'.','');
$ord_tot=number _format($ord_to t,2,'.','');
$paypal_content .=
'
document.write( "<input type=\"hidden\" name=\"shipping \" value=\"'.$ship ping_cost.'\">" );
document.write( "<input type=\"hidden\" name=\"tax_cart \" value=\"'.$tax. '\">");
document.write( "<input type=\"hidden\" name=\"tot_amt\ " value=\"'.$ord_ tot.'\">");
document.write( "<input type=\"hidden\" name=\"custom\" value=\"'.$paye r_session.'~~~' .$memberid.'~~~ '.$first_name.' ~~~'.$last_name .'~~~'.$email.' ~~~'.$username. '~~~'.$time.'~~ ~'.$order_no.'~ ~~'.$store_id.' ~~~'.$tax.'\">" );
document.write( "<input type=\"hidden\" name=\"night_ph one_a\" value=\"'.$phon e1.'\">");
document.write( "<input type=\"hidden\" name=\"night_ph one_b\" value=\"'.$phon e2.'\">");
document.write( "<input type=\"hidden\" name=\"night_ph one_c\" value=\"'.$phon e3.'\">");
document.write( "</form>");
document.main_f orm1.action="'. PAYPAL_URL.'";
document.main_f orm1.submit();
</script>';
echo $paypal_content ;[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Comment