The code I put on the board wasn't the actual code. The actual code I'm using is a realestate thing that I'm creating and it looks like this:
<?php
//The name variable works here
echo "$Name 1 <br>";
$messagetype = "buyer";
switch($messagetype)
{
case "buyer":
echo "$Name 2<br>";
buyer();
break;
case "seller":
seller();
break;
case "general":
general();
break;
default:
echo "Invalid Message Type";
break;
}
//The name variable works here when I
//make the switch statment go to defualt
function buyer()
{
//The name variable does not work here
echo "$Name 3<br>";
$sendto = "frankprogramer@earthlink.net";
$subject = "Buyer Request";
$message = "Name : $name \n
Address : $Address \n
City : $City \n
State : $State \n
Zip : $Zip \n
Phone : $Phone \n
Fax : $FAX \n
E-mail : $E-mail \n
Property Type -\n
Residential : $Residential\n
Commercial : $Commercial \n
Land : $Land \n
Investment : $Investment\n
Specific Requirements -
Area/s Interested in : $AreasInterestedIn\n
of Bedrooms : $Bedrooms \n
of Baths : $Baths \n
of Square Feet : $SQFT\n
Car Garage : $CarGarage \n
Price Range : $PriceRange \n
Other Requirements : $OtherRequirements
Comments : $Comments \n
";
//The name variable does not work here
echo $Name;
mail($sendto, $subject, $message);
exit;
}
The name variable will not work anywhere in the buyer function. Please Help.