Page 1 of 1

how to set value to inputs of a form

Posted: Wed Jul 27, 2005 3:22 pm
by php12342005
I have a form with 2 inputs (type=text), i.e. id and name.

when I click button Read, php reads info from database about id and name.
my question is:
how to set values (id and name) to these 2 inputs from php code?

thanks

Posted: Wed Jul 27, 2005 3:38 pm
by timvw

Code: Select all

if (!isset($id)) $id = 'default';

echo "<input type='text' name='id' value='$id'/>";

Posted: Wed Jul 27, 2005 4:12 pm
by php12342005
timvw,
it works, thanks.

one question:
is single speach mark ' the same as double speach mark " in php?

I can not find answer in google.

Posted: Wed Jul 27, 2005 4:15 pm
by timvw