Can you tell me why I cannot access var1 in the phpfunc?
#1 User enters the variable
<INPUT TYPE="text" NAME="var1" SIZE="5" MAXLENGTH="5" VALUE="<?php echo $var1 ?>">
#Call Funciton
<?php if (array_key_exists("submit", $_POST)) {
phpfunc(); ?>
#2 In the function I'm trying to access the variable var1
<?php }
function phpfunc() {
THIS VARIABLE IS EMPTY
echo $var1;
$email = 'mikeshn@email.com';
$email_from ='mikeshn@email.com';
echo ("<html>\n");
echo ("<body leftmargin=\"200\" topmargin=\"200\">\n");
if($POST){
foreach( $POST as $Key=>$Value )
{ $UserInput .= "<tr><td>".$Key."</td><td>".$Value."</td></tr>"; }
$Data = trim("<table border=\"1\">".$UserInput."</table>");
$About = "Nothing;
$headers = "From:".$email_from."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
mail($email, $About, $Data, $headers);
}
}
Any Ideas why I cannot access the variable in function phpfunc ?