Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Can anyone say if this code is right or wrong?

If(isset($_POST) && ($_POST[‘GET_PAYMENT’] == ‘1’))
{
    $totalAmount = $_POST[‘GET_PAYMENT’]; //Total amount
    $checkbox_id = $_POST[‘VALUE’]; // The radio button value 

    /* Here get the amount values (3,5.5 or 10) from 

    Database based on the $checkbox_id and store it in

    $amount variable*/


    $total_amount = $amount + $totalAmount;


    Echo $total_amount;

}

this is for my radio button which has seperate value when i clicks any one button it will be add with that previous value

javascript

Javascript function

Function getPaymentVal()
{

Var checkboxVal = ‘’;

checkboxVal = $("input[@name=’rmr’]:checked").val();

$.ajax({
   type: "POST",
   url: "ajax.php",
   data: "GET_PAYMENT=1&VALUE=”+ checkboxVal,
   success: function(total_amount)
   {
    //Assigning the final value to the hidden value here
    $(‘#totalamount’).val(total_amount);  

    //Here changing the display of total amount
    $(‘#repair_total_amount’).html(“Total <span class="repair-finalamount-txt">&pound;&nbsp;”+ total_amount+”</span>”);

   }
 });

}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
217 views
Welcome To Ask or Share your Answers For Others

1 Answer

Look at this code, I think it's possible because of the " and ' characters which is pasted poorly from another different-character-encoding source. You should type it again to see if the errors happen.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...