...

View Full Version : Using phpmail()



westmatrix99
12-29-2006, 10:10 PM
Try this one, just google phpmail() for the same script.

Hi this is a script that I got off the phpmail() site but can't do an if then else statement if someone is not registered on the site, any help would be great.

Thanks West

<?php require_once('Connections/cnfur.php'); ?>
<?php
$colname_rsforgot = "-1";
if (isset($_POST['email'])) {
$colname_rsforgot = (get_magic_quotes_gpc()) ? $_POST['email'] : addslashes($_POST['email']);
}
mysql_select_db($database_cnfur, $cnfur);
$query_rsforgot = sprintf("SELECT * FROM memlogin WHERE memEmail = '%s'", $colname_rsforgot);
$rsforgot = mysql_query($query_rsforgot, $cnfur) or die(mysql_error());
$row_rsforgot = mysql_fetch_assoc($rsforgot);
$totalRows_rsforgot = mysql_num_rows($rsforgot);
$name = $row_rsforgot['memUsername'];
$email = $_POST['email'];
$password = $row_rsforgot['memPassword'];
require("mail.inc.php");
$mail = new my_phpmailer;
$mail->AddAddress ($email);
$mail->Subject = "Lost password";
$mail->Body = "Please note that if the password field is blank, then you are not registered with Furkids.\nIf you would like to register goto http://www.furkids.co.za\n\n\n\nPassword as requested from Furkids.\nDo not share your password with anyone. \nIf you forget your password, you may have it emailed to you. Please ensure you keep your email address current. \n\nUsername: $name \nPasword: $password\n\nClick here to continue: \nhttp://www.furkids.co.za \n\n\n\n\n\n\n\nTo access this site if the link is not working; just copy and paste this link below into your web browser. \n\nhttp://www.furkids.co.za \n\nThanks for your support!";
if(!$mail->Send()){
echo "There was an error sending the message";
}
else{
echo "Your password has been sent to your email. <a href='javascript:self.close();'>Close window</a><br> Login once you have received your email.";
}
?>
<?php
mysql_free_result($rsforgot);
?>

xconspirisist
12-29-2006, 10:18 PM
I refuse to answer your question for the following reasons:

1) You did not use [php] tags to paste your code.
2) You manner of asking questions and the background knowledge you provided was dire.
3) This is the third identical topic you have posted in this forum. If nobody is answering your topics, try rephrasing your post accordingly.

There are other forum rules that you have voilated, I suggest you go and read them, then come back to this topic and post a suitable reply.

firepages
12-30-2006, 12:44 AM
I have deleted the duplicate threads... my problem is I do not understand the question, please explain.

westmatrix99
12-30-2006, 07:13 AM
What I am trying to say is that I modified this script for someone who is registered on any of my sites that they can get a password through email, if they are not registered the message should say:

There was an error sending the message
OR
Sorry you are not registered with furkids or any other site.

You can give it a try:

Go to http://www.furkids.co.za
Click on login and then select forgot password:
You will then notice that you get an email even if you are not rgistered.

Does that make sense?

westmatrix99
12-30-2006, 07:15 AM
What do you mean by php tags?
Look if you don't want to answer a question then that's your issue!
What forum rules are you talking about?

westmatrix99
12-30-2006, 07:20 AM
Sorry what duplicate threads, this is the first time I am posting here, OK now it's the second.

What I am trying to say is that I modified this script for someone who is registered on any of my sites that they can get a password through email, if they are not registered the message should say:

There was an error sending the message
OR
Sorry you are not registered with furkids or any other site.

You can give it a try:

Go to http://www.furkids.co.za
Click on login and then select forgot password:
You will then notice that you get an email even if you are not rgistered.

Does that make sense?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum