Posted by news.tpg.com.au on 05/28/05 07:49
This is probably quite easy but I think I'm getting the syntax wrong
somewhere.
I have a form to update user details and it would be NICE if I could obtain
those user details from the database and place it directly into the form on
the condition that a cookie is set for the user.
Originally I had an HTML form not even considering the possibility. Set up
similar to the below.
<table>
<tr>
<td>Your First Name: </td>
<td><input name="First" type="text" id="First">
example: Joe</td>
</tr>
</table>
So I tried renaming a couple of files, this one to a PHP and tried putting
some PHP in there for the value field of input like so:
<table>
<tr>
<td>Your First Name: </td>
<td><input name="First" type="text" id="First" value="
<?php
if( isset($_COOKIE[User]) ) echo '$_COOKIE[User]';
?>
">
example: Joe</td>
</tr>
</table>
The input box field fills in but with an error rather than the value of the
username.
Any ideas anyone?
[Back to original message]
|