Problem in responsetext and if condition
I have a simple form for testing on displaying material data from barcode and I substr the value.
for example the barcode = '10001CHE00102401100200250000.50'
po_number = 10001
item_code = CHE001
supplier = 024
uom = 01
unique_id = 100200
qty = 250000.50
if the barcode has all its data or it has no problem or no missing info like po_number or item_code or the supplier from the database, it will display the information but if it is not match on the database data. I want to display a notification that the barcode is invalid.
I attached my code, database and sample screenshots my problem is on displaying the notification .
I tried to fix it but I can't figured out why it did not display.
In the getbarcode_data.php file, remove the "?>" at the end. PHP does NOT require you to close off their tag at the end of the file. This will prevent any tailing whitespaces that you may be receiving causing your comparison to fail.
If doing this makes you uncomfortable, you could also "die" your results instead of echo'ing them (but this also terminates the script, and immediately passes back the output):
Obviously the first suggestion is what I would recommend, as I've been doing this for years.
die($po_number . "^" . $unique_id . "^" . $row["kind"] . "^" . $row["item_code"] . "^" . $row["supplier_code"] . "^" . $row["dspi_uom"] . "^" . $row["supplier"] . "^" . $qty);
Last edited by bionoid; 10-08-2013 at 06:02 AM.
Originally Posted by bionoid
I tried all your suggestions, but still the Invalid Barcode display on the first textbox same output like on my sample images attached before.
I attached my updated code.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)