Hello guys.
i am trying to create a php + ajax form that enables the user to make a transfer from their account to another.
is this correct what i am doing so far?
`for the ajax file
function sendpayment(){
var payment = _("SendPayment").value;
var touser =_("ToUser".value;
if (payment == "") {
_("status").innerHTML = "Type Amount";} else {
_("status").innerHTML = "Processing.."; }
{
var ajax = ajaxObj("POST", "payment.php");
var response = ajax.responseText;
if(response == "success"){
_("paymentform").innerHTML = '<h3>Your Payment was Sucessful</h3>';}
else {
_("status").innerHTML = 'Your payment has not been sucessful';}
}
}
ajax.send("payment="+payment+"&touser="+toUser+");`
// FOR THE HTML FILE
<form name="sendpayment" method="post" action="payment.php">
<label for="SendPayment">Payment</label>
<input type="text" name="SendPayment" id="SendPayment">
<label for="ToUser">To User:</label>
<input type="text" name="ToUser" id="ToUser">
<input name="Send" type="button" id="paymentdone()" value="Send Payment">
</form>
I am a total newbie yet when it comes to php, i would love to hear your feedback and pointing me in the right direction.
Kind greetings. :D