Jump to content

Help Needed


whizzykid

Recommended Posts

Hi i have created my database and form but anytime people register i dont knw until i get to refresh my database.

 

Can anyone help with a code to send me a mail  anytime a new registration is done?

this is my code

 

  mysql_select_db($database_inteecom_ellen, $inteecom_ellen);
  $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error());

  $insertGoTo = "Thank you.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_inteecom_ellen, $inteecom_ellen);
$query_Recordset1 = "SELECT * FROM register";
$Recordset1 = mysql_query($query_Recordset1, $inteecom_ellen) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>

Link to comment
Share on other sites

It's very easy actually. You use the mail function. Put this inside your success page.

 

$youremailaddress = 'email@address.com';
$subject = 'Someone just signed up.';
$message = 'Go check it out.';
mail($youremailaddress, $subject, $message);

Link to comment
Share on other sites

Actually, place it right after this line:

 

$Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error());

 

That way, if someone refreshes the page, it won't send you an email every single time.

Link to comment
Share on other sites

Hi thank you used it this way but didnt work.

mysql_select_db($database_inteecom_ellen, $inteecom_ellen);
  $Result1 = mysql_query($insertSQL, $inteecom_ellen) or die(mysql_error());
  $youremailaddress = '..........@yahoo.com';
  $subject = ' just Registered up.';
  $message = 'one new entry.';
mail($youremailaddress, $subject, $message);

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.