mercredi 27 novembre 2019

How to allow just data from an array into an input field?

for explanation i need this information for a project to handle Datamatrixcode - till this moment just everytime a number.

Okay i have a table with some numbers (unique_codes) and i take this numbers via SELECT these from a table (MySQL) and put them to an array ($row).

Scenario: the worker scans a number (and this numbers MUST BE a number from this $row list - then i $_POST this $row to other site to take it for the next step) otherwise i want a Error Exception.

My idea goes to us pattern like:

<form action="next site.php" method="post">
<input pattern="<?php $row['unique_code']; ?>"/>
<button class="btn btn-success">Send</button>
</form> 

But this doesn´t work. How can i solve this? Try and catch as an alternativ ?

Aucun commentaire:

Enregistrer un commentaire