daena76 Posted June 17, 2006 Share Posted June 17, 2006 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 templatesrequire_once("templates/HeaderTemplate.php");require_once("templates/RegistrationTemplate.php");require_once("templates/FooterTemplate.php");?>================================================================ Quote Link to comment https://forums.phpfreaks.com/topic/12213-how-do-i-get-e-mail-notification-for-a-new-member/ Share on other sites More sharing options...
aebstract Posted June 17, 2006 Share Posted June 17, 2006 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 Link to comment https://forums.phpfreaks.com/topic/12213-how-do-i-get-e-mail-notification-for-a-new-member/#findComment-46556 Share on other sites More sharing options...
daena76 Posted June 17, 2006 Author Share Posted June 17, 2006 [!--quoteo(post=384862:date=Jun 16 2006, 09:18 PM:name=aebstract)--][div class=\'quotetop\']QUOTE(aebstract @ Jun 16 2006, 09:18 PM) [snapback]384862[/snapback][/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* Quote Link to comment https://forums.phpfreaks.com/topic/12213-how-do-i-get-e-mail-notification-for-a-new-member/#findComment-46570 Share on other sites More sharing options...
homchz Posted June 17, 2006 Share Posted June 17, 2006 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 Link to comment https://forums.phpfreaks.com/topic/12213-how-do-i-get-e-mail-notification-for-a-new-member/#findComment-46573 Share on other sites More sharing options...
daena76 Posted June 17, 2006 Author Share Posted June 17, 2006 [!--quoteo(post=384879:date=Jun 16 2006, 11:10 PM:name=homchz)--][div class=\'quotetop\']QUOTE(homchz @ Jun 16 2006, 11:10 PM) [snapback]384879[/snapback][/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\" /] Quote Link to comment https://forums.phpfreaks.com/topic/12213-how-do-i-get-e-mail-notification-for-a-new-member/#findComment-46581 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.