On 14 May 2007 in macromedia.dreamweaver.appdev, geschenk
wrote:
> youïre approach is correct, but youïll need to
enclose the text
> fieldïs value in <?php ... ?> and in here
"echo" the variable,
> means:
>
> <td><input name="textfieldtotalvalue"
type="text" id="textfieldtotalvalue" value="<?php echo
$totalvalue; ?>"></td>
>
> The way it ïs now, the visitor would be able to
change or erase the
> fieldïs contents, so if you donït want this to
happen, you should
> better make this a hidden field, means...
>
> <input type="hidden" name="textfieldtotalvalue"
id="textfieldtotalvalue" value="<?php echo $totalvalue;
?>">
>
>
> ...and additionally "echo" the result as plain text
Actually, since this is a derived value, it shouldn't be
stored in the
database at all; it should be calculated when the value comes
out of
the database. At a minimum, the calculation should be done
serverside, just before inserting it. Any time you create the
value
by calculating clientside, some enterprising site visitor
could create
their own form to submit this information.
You can display the information in unchangable form like
this; note
the 'disabled' attribute:
<input
name="textfieldtotalvalue"
type="text"
id="textfieldtotalvalue"
value="<?php echo $totalvalue; ?>"
disabled="disabled">
--
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/contact.php