im doing a edit profile page. the page would pull out data frm mysql and populate the forms respectively.
user will edit and update their profile. The page would then validate the value in the form. if there's an error, it would prompt the user. when this happen, the form do not retain the newly entered value but instead re-display what is pull out from the database.. how do i retain the newly entered value in the textbox?
here is my code:[code=php]
<?php
//extract customer info
$query = "SELECT * FROM advertiser_test WHERE status='Enabled ' AND cid='$cid'";
$result = mysql_query($qu ery,$conn);
$rs = mysql_fetch_ass oc($result);
...
//process logic
//update db
?>
<html>
..
<body>
<input name="txtEmail" type="text" id="txtEmail" value=<?php echo $rs['email']?> >
</body>
</html>[/code]
i understand that the reason is because when the re-page load, it would pull out user info frm mysql n re-display it into the text box.. so is there a way around it?
user will edit and update their profile. The page would then validate the value in the form. if there's an error, it would prompt the user. when this happen, the form do not retain the newly entered value but instead re-display what is pull out from the database.. how do i retain the newly entered value in the textbox?
here is my code:[code=php]
<?php
//extract customer info
$query = "SELECT * FROM advertiser_test WHERE status='Enabled ' AND cid='$cid'";
$result = mysql_query($qu ery,$conn);
$rs = mysql_fetch_ass oc($result);
...
//process logic
//update db
?>
<html>
..
<body>
<input name="txtEmail" type="text" id="txtEmail" value=<?php echo $rs['email']?> >
</body>
</html>[/code]
i understand that the reason is because when the re-page load, it would pull out user info frm mysql n re-display it into the text box.. so is there a way around it?
Comment