View Single Post
Old 03-13-2005, 09:58 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
Hi Saul,

With PHP, you don't really have to check if the variable is set. If it is not, it will just echo nothing. PHP is not as strict as other languages.

The quickest way to write the code above would be like this:
PHP Code:
User ID: <input type="text" name="user_id" size="20" tabindex="2"
maxlength="127" value="<?=$Mydata['user_id']?>">
<?=$somevar?> is a shortcut in php to print the variable.

As for your 'note', .. it really doesn't matter if there are elements in the html form that don't exist in the PHP. Think of PHP as a tool to generate text.

Quote:
Is there a way to preset default browses DOM data from PHP, setting the form values in advanced?
this question threw me off a bit. The following questions don't really make sense to me too. Maybe I can explain it like this.

PHP executes on the server-side, Javascript executes in the browser on the client side. So does HTML. So, by the time you see HTML on the web page, PHP is done processing it. You're just using PHP to generate text.

Hope that helps somewhat.
__________________
Mike
sde is offline   Reply With Quote