1
Script in PHP.
My database has 3 fields:
id, name, telephone.
I need to update the data of 1 record.
On the first page, I ask for an input, the name of the record to change, and a "Search" button to locate the record to be changed.
On the second page I place the 2 fields for editing:
$nome_g1 = isset($_GET["nome"])?$_GET["nome"]:"";
$arma1 = isset($_GET["telefone" ])?$_GET["telefone" ]:"";
I would like the fields to be already filled with the data of the selected record.
Example:
1st page I typed "Antonio", and the script found the record with the name "Antonio" and the Telephone "99999.9999".
second page:
Name...: [Antony]
Tel.: [99999.9999]
Button: [update]
The question is: how the data appear in the fields as soon as it enters the second page, before typing, ie in the line of "input"
It worked fine, but I couldn’t mount it to "select" and "radio": -- Status: <select name="state_"> <option value="MG" >Minas G</option> <option value="SP" >S paulo</option> <option value="RJ" >R Jan </option> </select> --- <fieldset><Legend> gun: </Legend> <input type="radio" name="state" value="MG" /><label for="MG">MG     </label> <input type="radio" name="state" ="SP value" /><label for="SP">SP     </label> <input type="radio" name="state" value="RJ" /><label for="RJ">RJ </label> </fieldset> ---
– Orlando FMC
I added in the answer, but when it is so, you have to already put the details all right in the question.
– Bacco
I couldn’t assemble for radio and checkbox. I’m a freshman.
– Orlando FMC
Ai uses
checked
instead ofselected
. Not that it’s a problem for me to tell you what to do, but if you learn to read HTML documentation and search, it’s much easier for you to learn (otherwise you’ll always be copying and pasting instead of actually programming)– Bacco
That’s what else I’m doing!!!
– Orlando FMC