Jump to content


Photo

How do I get e-mail notification for a new member?


  • Please log in to reply
4 replies to this topic

#1 daena76

daena76
  • New Members
  • Pip
  • Newbie
  • 8 posts
  • LocationRockville, Maryland USA

Posted 17 June 2006 - 12:48 AM

I have a big problem. I got a membership script that does not notify web owner (me) of new sign-ups. Hence, no idea if someone registered and I can't activate membership. How and what do I add to the code below. The code here is the register.php file that points to the welcome page after a successful submit. (I am exceptionally a newbie so if you could just hold my hands and walk me through it, it'll be greeeeaat!) *wink TY ~Danes
===================================================================
<?
require_once("conn.php");
require_once("includes.php");

if(isset($_POST[s1]))
{


$q1 = "insert into class_members set
username = '$_POST[NewUsername]',
password = '$_POST[p1]',
FirstName = '$_POST[FirstName]',
LastName = '$_POST[LastName]',
Address = '$_POST[Address]',
City = '$_POST[City]',
State = '$_POST[State]',
ZipCode = '$_POST[ZipCode]',
Country = '$_POST[Country]',
Phone = '$_POST[Phone]',
AlternatePhone = '$_POST[AlternatePhone]',
Fax = '$_POST[Fax]',
email = '$_POST[email]',
RegDate = '$t' ";

mysql_query($q1);

if(mysql_error())



{
$error = "<font face=verdana size=2 color=red><b>The username <font color=black>$_POST[NewUsername]</font> is already in use!<br>Select another one, please!</b></font>";

unset($_POST[NewUsername]);
}
else
{
$last = mysql_insert_id();
$_SESSION[AgentID] = $last;


header("location:welcome.php");
exit();
}



}

//get the templates
require_once("templates/HeaderTemplate.php");
require_once("templates/RegistrationTemplate.php");
require_once("templates/FooterTemplate.php");

?>
================================================================


#2 aebstract

aebstract
  • Members
  • PipPipPip
  • Advanced Member
  • 1,105 posts

Posted 17 June 2006 - 01:18 AM

Hello,
You're just wanting a simple mail sent to you whenever someone signs up? Try this:


Right after this part:
$last = mysql_insert_id();
$_SESSION[AgentID] = $last;



Enter the following, but be sure to change around the information that you set variable to, set it to whatever you wish it to send to you. This variable will be the body of your email.

$variable = "$_POST[FirstName] $_POST[LastName] has just registered";

mail ($email, 'New User', $variable, 'From: _____@____.com');



Also change $email to the variable or exact address you want this mail to be sent to. The from is straight forward, it can be a variable or exact wording also. Any questions, just ask. Hope this helps.

There is an area of the mind that could be called unsane, beyond sanity, and yet
not insane. Think of a circle with a fine split in it. At one end there's
insanity. You go around the circle to sanity, and on the other end of the
circle, close to insanity, but not insanity, is unsanity.


#3 daena76

daena76
  • New Members
  • Pip
  • Newbie
  • 8 posts
  • LocationRockville, Maryland USA

Posted 17 June 2006 - 02:56 AM

[!--quoteo(post=384862:date=Jun 16 2006, 09:18 PM:name=aebstract)--][div class=\'quotetop\']QUOTE(aebstract @ Jun 16 2006, 09:18 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hello,
You're just wanting a simple mail sent to you whenever someone signs up? Try this:
Right after this part:
$last = mysql_insert_id();
$_SESSION[AgentID] = $last;
Enter the following, but be sure to change around the information that you set variable to, set it to whatever you wish it to send to you. This variable will be the body of your email.

$variable = "$_POST[FirstName] $_POST[LastName] has just registered";

mail ($email, 'New User', $variable, 'From: _____@____.com');
Also change $email to the variable or exact address you want this mail to be sent to. The from is straight forward, it can be a variable or exact wording also. Any questions, just ask. Hope this helps.
[/quote]

Hi! This is what I put in:

$variable = "$_POST[FirstName] $_POST[LastName] $_POST[email] has just registered";

mail ($email, 'New User' $variable, 'From:pepsi@pepsi.kom');

It seems I did something wrong cuz I did not receive any e-mail. *sorry :-( i'm slow*



#4 homchz

homchz
  • Members
  • PipPipPip
  • Advanced Member
  • 93 posts
  • LocationLee, New Hampshire

Posted 17 June 2006 - 03:10 AM

I think you have to designate the $email variable as your email address, in the script. Or since this will only go to you just replace $email with your address.

#5 daena76

daena76
  • New Members
  • Pip
  • Newbie
  • 8 posts
  • LocationRockville, Maryland USA

Posted 17 June 2006 - 03:42 AM

[!--quoteo(post=384879:date=Jun 16 2006, 11:10 PM:name=homchz)--][div class=\'quotetop\']QUOTE(homchz @ Jun 16 2006, 11:10 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I think you have to designate the $email variable as your email address, in the script. Or since this will only go to you just replace $email with your address.
[/quote]


Thanks a lot to both of you!! I now have an effective new user e-mail delivery. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users