Re: New User Sign up Notification

From: Date: Sun, 24 Dec 2006 00:43:01 +0000
Subject: Re: New User Sign up Notification
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-246183@lists.php.net to get a copy of this message
Casey Chu wrote:
I still do not understand. Isn't that what your script already does? On 12/23/06, Casey Chu <heavyccasey@gmail.com> wrote:
What do you mean by "now"? On 12/22/06, JMCS Niagara (Jeff) <jeffsmobile@cogeco.net> wrote:
hi there. I'm looking to create a new user signup. So when someone
signs up, it emails admin the Username, Real Name, and IP address.
I have this code called newusersignupnotification.php <?php $to = 'admin@youronlinespace.com'; // The email address you want
the notification sent to
$subject = 'Member has registered on YoS'; // What do you want the
subject line of your notification to be?
$memberSpecs = "<hr size=2 width=300 align=left>". "<b>Username:</b> ".$_SESSION['username']. "<br>". "<b>Real Name:</b> ".$_SESSION['firstname']. "
".$_SESSION['lastname'].
"<br>". "<b>Date</b> ".date('l dS \of F Y h:i:s A'). "<br>". "<b>IP address:</b> ".$_SERVER['REMOTE_ADDR']. "<br>". "<b>System Specs:</b> ".$_SERVER['HTTP_USER_AGENT']. "<br>"; $headers = "Content-type: text/html \nFrom:
admin@youronlinespace.com";
$body = "<body> <br> <table cellspacing=1 cellpadding=2 align=center> <tr> <td> <b><font face=arial size=2>A new member has registered! </font></b> </td></tr> <tr> <td> <font face=arial size=2> ".$memberSpecs." </font> </td></tr></table> </body>"; mail($to,$subject,$body,$headers); ?> When I place this in the "join.php" file .. When someone goes to
join.php it automatically emails it .. and I get date, time, ip, etc etc everything except for the username and first name.. Obviously, because the person hasn't typed in anything.
When they filled out the sign up form, There's a button that says
Sign Up .. Basically, when they click this button, NOW is when I want it to email me the details.
Any ideas? Thanks guys
If the user is clicking a sumbit button, the easiest way would be to put at the top:
if($_REQUEST["Submit"] == "whatever your button says"){ mail(blah); // process the signup or redirect to the next page. } rest of join.php goes here. Note: You will have to make the submit button action join.php.

« previous php.general (#246183) next »