Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Using phpmail()

  1. #1
    Regular Coder westmatrix99's Avatar
    Join Date
    Dec 2006
    Location
    South Africa
    Posts
    307
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Using phpmail()

    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);
    ?>

  • #2
    Regular Coder xconspirisist's Avatar
    Join Date
    Jun 2006
    Location
    Great Britain.
    Posts
    138
    Thanks
    1
    Thanked 6 Times in 6 Posts
    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.
    If I have been helpful, use the "thank" button - It makes me happy!

    xconspirisist.co.uk - homepage of my online alias
    technowax.net - a community for people interested in all forms of modern technology.

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,108
    Thanks
    11
    Thanked 101 Times in 99 Posts
    I have deleted the duplicate threads... my problem is I do not understand the question, please explain.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    Regular Coder westmatrix99's Avatar
    Join Date
    Dec 2006
    Location
    South Africa
    Posts
    307
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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?

  • #5
    Regular Coder westmatrix99's Avatar
    Join Date
    Dec 2006
    Location
    South Africa
    Posts
    307
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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?

  • #6
    Regular Coder westmatrix99's Avatar
    Join Date
    Dec 2006
    Location
    South Africa
    Posts
    307
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •