Hi dhossai,
I think alexgeek just missed one
PHP variable in the
HTML form.
The correct version should look like this
- PHP: Select all
<?php
require "check.php";
// If member has logged in then below script will be execuated.
// let us collect all data of the member
$row=mysql_fetch_object(mysql_query("select * from tbl_login where userid='$_SESSION[userid]'"));
?>
<form action='update-profileck.php' method='post'/>
<input type=hidden name=todo value=update-profile>
<fieldset>
<legend>Update Profile</legend>
<label for="LastName">Last Name</label>
<input id="LastName" name="LastName" value="<?php echo $row->Last_Name ?>" type="text"/><br/>
</fieldset>
</form>
<?php echo "<br/>Welcome $_SESSION[userid] <br/><br/>Click <a href=logout.php>here to logout</a> | <a href=change-password.php>Change Password</a>| <br/>";
?>
One important thing when programming
PHP is that all the
PHP code needs to be enclosed in the <?
php ?> tags, while all the
HTML code must be placed outside those tags. When outside the tags, you cannot use the
PHP variables, so you have to open and close the
PHP tags, whenever you want to produce dynamic content.
See how, in the last line, the echo command is used to generate
HTML. This is how
HTML is generated when inside the <?
php ?> tags.
Btw also note that I've replaced the single quotes around the
value field with double quotes.