I come from a corporate C background and I find style to be important in
readability. Especially when multiple people are working on the same code.
I have seen 3 way to deal with large bocks of static HTML code in PHP. What
are your preferences? I have listed the techniques in the order of my
preference.
Hope I don't start an argument ;)
Mark C
Method 1:
switch ($_POST[Mode])
{
case "":
?>
<br><span class='instruct '>Select the area you need to administer.</span>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="User">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Church">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Ministry ">
</form>
<?php
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
=============== =============== =============== =========
Method 2:
switch ($_POST[Mode])
{
case "":
print "<br><span class='instruct '>Select the area you need to
administer.</span>";
print "<form action=\"Admin. php\" method=\"post\" >";
print " <input type=\"submit\" name=\"Mode\" value=\"User\"> ";
print "</form>";
print "<form action=\"Admin. php" method="post">" ;
print " <input type=\"submit" name="Mode" value="Church"> ";
print "</form>";
print "<form action=\"Admin. php\" method=\"post\" >";
print " <input type=\"submit\" name=\"Mode\" value=\"Ministr y\">";
print "</form>";
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
=============== =============== =============== =========
Method 3:
switch ($_POST[Mode])
{
case "":
$Var = <<<EOQ
<br><span class='instruct '>Select the area you need to administer.</span>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="User">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Church">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Ministry ">
</form>
EOQ;
print $Var;
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
readability. Especially when multiple people are working on the same code.
I have seen 3 way to deal with large bocks of static HTML code in PHP. What
are your preferences? I have listed the techniques in the order of my
preference.
Hope I don't start an argument ;)
Mark C
Method 1:
switch ($_POST[Mode])
{
case "":
?>
<br><span class='instruct '>Select the area you need to administer.</span>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="User">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Church">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Ministry ">
</form>
<?php
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
=============== =============== =============== =========
Method 2:
switch ($_POST[Mode])
{
case "":
print "<br><span class='instruct '>Select the area you need to
administer.</span>";
print "<form action=\"Admin. php\" method=\"post\" >";
print " <input type=\"submit\" name=\"Mode\" value=\"User\"> ";
print "</form>";
print "<form action=\"Admin. php" method="post">" ;
print " <input type=\"submit" name="Mode" value="Church"> ";
print "</form>";
print "<form action=\"Admin. php\" method=\"post\" >";
print " <input type=\"submit\" name=\"Mode\" value=\"Ministr y\">";
print "</form>";
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
=============== =============== =============== =========
Method 3:
switch ($_POST[Mode])
{
case "":
$Var = <<<EOQ
<br><span class='instruct '>Select the area you need to administer.</span>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="User">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Church">
</form>
<form action="Admin.p hp" method="post">
<input type="submit" name="Mode" value="Ministry ">
</form>
EOQ;
print $Var;
break;
case "User":
$hits = GetEMailList($m n[MinistryID]);
Comment