I'm adding a new feature to the add-user script.
Once the new user is entered, the admin has the option to send the user's details at that point or wait til later.
I tried to make it a function inside the script, but couldn't make the call from an anchor tag, so I decided to make it a separate page. I used a form with one submit button and hidden tags to send the data via GET.
The mail was not sent and my error checking showed that the variables are not coming through. What can I do?
From addnew.php
...?> //in the HTML section
<form action="email_user.php" method="get"><input type="submit" value="SEND USER EMAIL"/>
<input type=hidden value="$login" />
<input type=hidden value="$password" />
<input type=hidden value="$email" />
</form><br />
mail_user.php
$to=$_GET[email];
$login=$_GET[login];
$password=$_GET[password];
echo $to;
echo $login;
echo $password;
$subject = "Login Information";
$headers = "From: No Reply customerservice@email.com\n";
$body = "Here are your login details:\n";
$body .="Username:". $login. "\n";
$body .="Password:". $password. "\n";
$body .="Make sure you login and change your password immediately.";
if(mail($to,$subject,$body,$headers))
{
echo "Login Details Sent to";
echo $to;
}
else
{
echo "Message Not Sent";
}
Thanks!