In Php, send hidden data to the database

Asked

Viewed 28 times

-1

I have a form in an application where the user needs to register Cellular placing the code of Brazil (+55), but I want to facilitate the form sending the +55 in a hidden way to the BD, la in the database must appear registered so (+5544999990000) but the user will only enter with DDD and the number, follow the form I need to edit.

It’s best to edit the code, or leave +55 right in the database?

inserir a descrição da imagem aqui

Thanks in advance.

1 answer

0


Hello all right? This can be solved for when you perform the data sending query with php, Voce leaves a fixed string of "+55" and concatenates with the value of the form, which is the user number.

INSERT INTO tb_usuarios (nome, numeroCEL) values ('alan', '+55'.$valueFromCampoNumero);

Sorry if I missed something, I’m rusty in php and Mysql

  • Alan thanks for the help, but I can put the +55 right in the code above?

  • Yes, Voce can use the tag "value", so when the user comes across the field, the string "+55" will be "typed", so he can edit this value But what I recommend to you is to do the same database strategy, more matches what Voce seems to want.

  • 1

    Thank you very much Alan..

  • You’re welcome! If this really solved your problem, please mark my answer as correct, so people don’t need to enter since it is solved

Browser other questions tagged

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