Search the Community
Showing results for tags 'php;'.
-
I have this code that i tried running it on my phpmyadmin it works fine ,but when i use it on my php code to query its not working.What could be the issue? SELECT * FROM `roombook` ORDER BY (CASE stat WHEN 'Checked in' THEN 1 WHEN 'Booked' THEN 2 WHEN 'Deposit Confirmation' THEN 3 WHEN 'Email/phone' THEN 4 WHEN 'Checked Out' THEN 5 ELSE 'Cancelled' END) ASC, stat ASC
-
I have created a php page that needs to validate if the amount entered is less than 100or must return an error. My function though does not get called when clicking submit even if the amount is less than 100 but link goes straight to the actioned page <html> <head></head> <title></title> <style> .error {color: #FF0000;} </style> <body> <?php function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } $amountErr=""; $amount=""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (["amount"]<100) {$amountErr = "Value must be equal or greater than 100";} else {$amount = test_input(["amount"]);} } ?> <p><span class="error">*required field.</span></p> <form action="https://www.moneybookers.com/app/payment.pl" method="post"> <input type="hidden" name="pay_to_email" value="my email account"/> <input type="hidden" name="status_url" value="http://example.com/verify.php"/> <input type="hidden" name="return_url" value="return_page"/> <input type="hidden" name="language" value="EN"/> Amount:<input type="text" name="amount"/> <span class="error">*<?php echo $amountErr;?></span> <input type="hidden" name="currency" value="USD"/> <input type="hidden" name="detail1_description" value="YourApp"/> <input type="hidden" name="detail1_text" value="New Deposit"/><BR> <input type="submit" value="Deposit!"/> </form> </body> </html>