Hello,
having trouble passing variables and functions as arguments to php functions eg
I define the function below which writes a table the table has a header in the first row which contains the $title, and $article in the next row that provides the article or content.
The code is as follows.
+++++++++++++++++++++++++++++++++
function print_right_holder($title , $article )
{
$art_holder = "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" width=\"100\">
<tr>
<td height=\"20\" bgcolor=\"000033\" class=\"right_headers\" align=\"center\"><p><font color=\"ffffff\" size=\"2\" face=\"verdana,arial,helvetica\">" . $title . "</font></p></td>
</tr>
<tr>
<td height=\"100\" background=\"zimages/rgt_bg.gif\" class=\"right_body\" valign=\"top\" align=\"center\">"
. $article . "</td>
</tr>
</table>";
print($art_holder);
}
+++++++++++++++++++++++++++++++++++++++++++
The function accepts normal arguments however when we try to pass variables as arguments we have a problem eg
++++++++++++++++++++++++++++++++++++++++++++
print_right_holder("Virus Downloads", "" );
++++++++++++++++++++++++++++++++++++++++++++
works perfectly, but passing the external variable (external to the function) $joinus_01 doesn't work ie
++++++++++++++++++++++++++++++++++++++++++
print_right_holder("Join Us", $joinus_01 );
++++++++++++++++++++++++++++++++++++++++++
Why not, how will it and if not what are my work arounds?