System to read barcode by mobile in PHP, is working. but wanted to know How to use $_GET Only when the user reads

Asked

Viewed 54 times

-2

inserir a descrição da imagem aqui It shows this error because it got to before the user even clicked on "Barcode", where it is redirected to the app to perform the barcode Cód reading. After it reads, the error disappears and the barcode is filled normally. Only take out this error by placing $_GET only after user read the Cód bar

inserir a descrição da imagem aqui

  • You are confusing concepts, to generate this screen on the server side, will execute the PHP code, so by sending to the browser you will have already run $_GET

  • yes, how do I run GET only after the user reads the code? I want to leave blank by default

1 answer

-1


You must use isset(), where it checks whether the variable was started.

Your code would look something like:

<?=isset($_GET['codigo']) ? $_GET['codigo'] : '';?>

Being false, does not return a Warning.

  • It worked buddy! you’re great! you can force a enter by php once it is filled?

  • Yes, it is possible. An example here https://answall.com/questions/114809/como-enviar-um-formul%C3%A1rio-automatically-when-the-inputs-are-filled

  • Opa, here it didn’t work because mine is only an input. it doesn’t have a form and neither Submit :(

  • What is the function of "enter"? Send what? Where? Anything opens a new question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.