I have an email form in php which has 3 possible appearances.
Firstly, when the submit button has not been used, I want it to appear standard.
Secondly, when submit HAS been clicked and no data was set in it.
Thirdly, when data was input acceptably, I want to display what was input.
However, I am a total php newbie and I don't seem to be able to get it right.
<?php
if(isset(sent)) {
if(isset($_POST['forename']) && !empty($_POST['forename']) {
echo('<input class="tbox" type="text" name="forename" value="$POST['forename']" /><br>');
} else {
echo('<input class="tbox bad" type="text" name="forename" value=""/><br>');
}
} else {
echo('<input class="tbox" type="text" name="forename" value="" /><br>') ;
}
?>
I assume the error is the "s and 's. I get an unexpected ) exception. How should the echo lines be constructed to avoid this?