by mattm948 » Mon Oct 17, 2011 8:56 pm
Yes *, you can use a variable from .php file and put it in html form field.
Example :
PHP File
===================================================================================================
<?php
$emailAddress = "info@sales.com" ;
?>
===================================================================================================
HTML/PHP File
===================================================================================================
<html>
<head>
</head>
<body>
<form>
<input type="text" name="email_field" size="30" value="<?php echo $emailAddress ; ?>" />
</form>
</body>
</html>
===================================================================================================
* Note however that there are PHP files called Templates or those with .TPL extensions. Putting in PHP variables within these files have a different method. It depends on the Templates that you are using. Usually you put the php variable in curly brackets like. Some templates won't allow this to work at all.
<input type="text" name="email_field" size="30" value="{ emailAddress "} />