Let's say that you are inside the phpcode and you have some type of loop or conditional statement, and if that statement/loop is true, a detailed html table prints out.
Does that table have to appear within the php code?
Meaning, does it have to look like this:
<?php
for ($i=0; $i < 10; ++$i) {
echo '<table>' . "\n";
echo ' <tr>' . "\n";
echo ' <td>Stuff here</td>' . "\n";
echo ' </tr>' . "\n";
echo '</table>' . "\n";
echo '<br>' . "\n";
}
?>
OR, can you start the php loop, close the php code, and then code the html? Will the html then ONLY be used if the loop/conditional statement is true? Here's an example:
<?php
for ($i=0; $i < 10; ++$i) {
?>
<table>
<tr>
<td>Stuff here</td>
</tr>
</table>
<br>
<?php
}
?>
I only ask cause I have a very long form which i want to validate via php. And I want this form to be inside a php if statement, so it will only execute if it has not been submitted yet or if there are invalid entries. Being able to code it the second way will save time.
Thanks.