Hi all, wondering what you guys opinion is on cleansing and validating data from a form to enter the database. This is how I’m currently entering data (no validation, though it’s not yet live). Any advice is greatly appreciated as always ![]()
//Push Data into Database
$sql = "INSERT INTO order_products (receipt_id, customer_id, product_name, product_price, product_quant, product_serial, product_code, product_cond, sub_total) VALUES ('$_POST[receiptno]','$_GET[id]','$product[name]','$blip','$product[quantity]','$product[serial]','$product[stock]', '$product[cond]', '$total')";
mysql_query($sql);
}
$addDet = "INSERT INTO orders (addedby, receipt_id, date_added, del_method, courier, spec_instr, cust_ref, date_dispatched, delivery_costs, part_exchange, vat_info, three_month_warranty, pay_method, delivery_address, deladd_name) VALUES ('$_SESSION[SESS_LOGIN]','$_POST[receiptno]',now(),'$_POST[delmethod]', '$_POST[courier]', '$_POST[specialinst]','$_GET[id]', '$_POST[dispatched]', '$postage', '$px', '$_POST[vatInfo]', '$_POST[warranty]', '$_POST[payment]', '$_POST[cdeladdress]', '$_POST[deladdressname]')";
mysql_query($addDet);