I have a section in my PHP page containing this bit of code:
echo '<div style="float:left;"><h3><strong>Edit User Account</strong></h3>
Date Registered: ' . $db_regdate . '<br>
User Type: ' . $usertype . '<br><br>
<form class="right_aligned" id="form1" name="form1" method="post" action="">
<label>First Name*</label>
<input name="firstname" type="text" id="firstname" value="' . $db_firstname . '"/>
<label>Last Name*</label>
<input name="lastname" type="text" id="lastname" value="' . $db_lastname . '" />
<label>Email Address*</label>
<input name="email" type="text" id="email" value="' . $db_email . '" size="32" />
<label>New Password</label>
<input name="password" type="password" id="password" size="10" />
<label>Verify Password</label>
<input name="verifypass" type="password" id="verifypass" size="10" />
<label>User Type </label>
<select name="usertype" class="header" id="usertype">
<option>Admin</option>
<option>Staff</option>
<option selected="selected">Client</option>
</select>
<label></label>
<input type="submit" name="submit_edit" id="submit_edit" value="save" />
</form>';
As you can see, I have concatenated (or whatever the appropriate term is) some essential variables within the form. This is basically an edit form so the variables basically load content from the database and display is on the form as 'initial values'.
What I'm trying to do it relocate the form to a file named edit_user.html. HOWEVER, if I try to use PHP include to include the form from an external file I do not get the same result. Instead of displaying the content of the variables, it does not parse the variables as a variable and instead it just displays:
' . $variable . ' in each field.
Where am I going wrong?
I am using this instead of the echo statement:
include('modules/forms/edit_user.html');
If I try to echo the include, I get the same result :(