replace input field with data from mysql php -


I have created this layout of the text input field continuously, 1- Enter the data in the empty field, click on the 2- button which A Php page that is updated in the database

The problem now is that when I come back to the main page, the empty field is replaced with the data, but still other empty fields enter new data I have to do

You have not done

< Pre> & lt; Input type = "text" name = "age" value = "& lt ;? php echo $ age ;? & gt;" & gt;

When the form is first loaded, then there will be no value for the conflict like the $ era, so the input will appear empty, submit the form by POST to the same PHP file, run your verification check , And if everything passes, then insert it into your database. (Is it necessary that you write the database at this point, or should you wait until the second section is filled?)

You must use some conditional statement to display the second part of the form Depending on how complex it is, or users will have to return later, you can do the following:

  1. To check completion, read the data back from the database, and then the second Show part To copy.
  2. Set a variable to track the form you are inside, and depending on it, show different sections to complete.

If you have a way to track the process you are in, you can do something like this:

$ formStage = 2 ; The function isReadOnly ($ formStage = '') {if ($ formStage == 2) {echo 'READONLY';}}

and then in your HTML:

  & lt; INPUT NAME = "realname" VALUE = "Hello there" & lt ;? Php isReadOnly ($ formStage)? & Gt; & Gt;  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

kernel - How to create a "Block device" in Windows -