I would like to know how to load data from one HTML into Other

Asked

Viewed 73 times

-1

I need to click on a new HTML the data provided by the first (HTML) to make the change. The proposal of the activity I am in doubt is as follows:

"as soon as the customer’s registration is carried out, a link to the client’s data change page that has just been inserted should be displayed."

The Register screen works but I need to know how to load the data on the new change page.

  • The first html page should have in the form "action" a php page that will save the data in the database. This php page should call another one with the link to another that will take the database data and display it. You must study html, php and write and read in database to do this. Take a look at w3schools.com there are a lot of cool things to learn there.

1 answer

0

Thomaz,

Probably your first registration HTML saved the data in a database, right?

When displaying the second, changing page, you should:

  1. Take the previously registered data from the database (with PDO, MYSQLI_* functions or some ORM)
  2. Place these values in your HTML form, for example:

    <input type="text" name="nome_usuario" value="<?=$usuario['nome']?>" />
    
  3. And take the action of changing the new form.

If you want to use the same HTML form on both the sign-up page and the edit page you need to take care of three things:

  1. Change the form action if it’s editing or registration:
<form action=""<?=$urlCadastrarOuAlterar?>"
  1. In the values of the fields, you will have to check if there is a user:
<input type="text" name="nome_usuario" value="<?=isset($usuario) ? $usuario['nome'] : ''?>" />
  1. In the case of editing, save the user id to an Hidden field.

Browser other questions tagged

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