|
Welcome,
Guest
|
|
|
Hi Lazro and community,
If someone visits the /pesapal/iframe.php directly, they get an error such as unknown column in field list. I assume this is because there is no form data posted when you visit this page directly. How can one define default values such that whether the form is filled or not, the database accepts the transaction and the iframe loads? |
|
|
|
Hello Unitanzania,
Just before storing the records and loading the iframe you can check if the variable has data, if not, set the default value. Have a look at the example below; if(isset($_POST['amount']) && $_POST['amount']){ $amount = $_POST['amount']; }else{ $amount = 1000; } This case simply be written as; $amount = (isset($_POST['amount']) && $_POST['amount']) ? $_GET['amount'] : 1000; This means if the post variable AMOUNT is set and has some value, pass the amount as the value posted. If the post variable is not set or the value is empty or 0, set the default as 1000 |
|
Regards,
Lazaro Ong'ele Web Developer Skype: Lazrotep +254-020-249-5438 ; +254-706-191-729 Dagoretti Lane, Off Naivasha Road. Facebook: www.facebook.com/pesapal Twitter: twitter.com/PesaPal Helpdesk: support.pesapal.com This e-mail address is being protected from spambots. You need JavaScript enabled to view it. |
|