I'm a seasoned Perl programmer that is a recent PHP convert. A couple things have puzzled me.
First, a more general issue. One of the inherent 'benefits' with PHP was that you could co-mingle it with HTML. After programming for a few weeks now I don't see any big benefit verus how I had to do things in Perl.
When you are displaying a form that you need to embed the values of many variables you still have to basically have PHP print the page out. Actually I see several option:
1) Use $form .= <<< EOFORM to append code to a variable and than print the variable.
2) Use echo <<< EOFORM to basically do the same thing.
3) Put the form in a separate file and place markers like {{variable_name}} and then read the file and replace the markers with the appropriate variable values.
4) Where where ever you need a variable value insert a <?php echo $this_variable ?>
None of these options offer any significant benefits when comparing the available options of how you would achieve this in Perl. Am I missing a better way?
Finally, it puzzles me that I can do this:
$posted_field = $_POST['some_field'];
echo "The value of the field is $posted_field";
But you can't do this:
echo "The value of the field is $_POST['some_field']";
Creates a lot of extra work. Again, am I missing a better way?
Thanks