this function is called from a Subscription form, clearly - i'm trying to send an email to the $name and $email address after a person registers,
just after 'INSERT INTO MEMBERS...' but for some reason the mail(); function doesn't work no matter where i put it. can someone please help?
trying to mail(); the $name and $email after "insert into table" - it doesn\'t work for some reason... insert works fine but the mail(); doesn't. anyone help?
if($function=="subscribe")
{
$name=$_POST["name"];
$lastname=$_POST["lastname"];
$street1=$_POST["street1"];
$city=$_POST["city"];
$state=$_POST["state"];
$zip=$_POST["zip"];
$country=$_POST["country"];
$email=$_POST["email"];
$username=$_POST["username"];
$password=$_POST["password"];
$narrative=$_POST["narrative"];
$nn=$_POST["nn"];
$ws=$_POST["ws"];
$fields=array($name,$lastname,$street1,$city,$state,$zip,$country,$email,
$username,$password);
$fieldsverbose=array('name','lastname','street1','city','state','zip','country','email',
'username','password');
$error="The following required fields were left blank:<br>";
for($count=0;$count<count($fields);$count++)
{
if ($fields[$count]=="")
{
$error .= $fieldsverbose[$count];
$error .= "<br>";
}
}
$query="select * from members where (username=\"$username\")";
$Result=mysql_query($query);
if($row=mysql_fetch_array($Result))
{
print("<link rel=\"stylesheet\" href=\"../styleNM.css\" type=\"text/css\"><table><tr><td width='100'></td><td><br><br><br>The username \"$username\" is already taken.<br><a href=\"javascript:history.back();\">Click here</a> to go back and choose another.</td></tr></table>");
}
$query="select * from members where (password=\"$password\")";
$Result=mysql_query($query);
if($row=mysql_fetch_array($Result))
{
print("<link rel=\"stylesheet\" href=\"../styleNM.css\" type=\"text/css\"><table><tr><td width='100'></td><td><br><br><br>That password is already taken.<br><a href=\"javascript:history.back();\">Click here</a> to go back and choose another.</td></tr></table>");
}
else
{
if($narrative==1)
{
$nn=1;
}
$query="insert into members (name,lastname,street1,street2,city,state,zip,country,email,username,password,narrative,nn,ws) values ('".$name."','".$lastname."','".$street1."','".$street2."','".$city."','".$state."','".$zip."',
'".$country."','".$email."','".$username."','".$password."','".$narrative."','".$nn."','".$ws."')";
if(mysql_query($query))
setcookie('username', $username, time()+(60*60*24*30), '/', '', 0);
print("<script language=\"javascript\">
top.location=\"105/login.php\";
</script>");
}
}