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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    138
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Variable not getting into email properly

    Everything here works fine, except the message that says "Your Password Is..." in the email - the variable is not making it into the email - what is wrong with my $message variable? Thanks!

    PHP Code:
    $sqlquery="SELECT * FROM table WHERE EmailAddress='$ForgotEmail'";

    $resultsmssql_query($sqlquery);

    $row mssql_fetch_array($results);

    $row['Password'] = $MailPassword;


    $num_rows mssql_num_rows($results);

    if (
    $num_rows 0) {
    $to $ForgotEmail;
    $subject "Your Owner Account";
    $message "Your password is '.$MailPassword.' ";
    $from "owneraccounts@mysite.com";
    $headers "From: $from";
    mail($to,$subject,$message,$headers);
    echo 
    "Your password has been emailed to you!";



    } else {


    header'Location: http://www.mysite.com/os_email_not_found.php' ) ;




    ;}
    ?> 

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by chornbeck View Post
    Everything here works fine, except the message that says "Your Password Is..." in the email - the variable is not making it into the email - what is wrong with my $message variable? Thanks!

    PHP Code:
    $row['Password'] = $MailPassword;

    $message "Your password is '.$MailPassword.' "
    echo the $MailPassword to see if is not empty and modify the code:
    PHP Code:
    $message "Your password is '".$MailPassword."' ";
    ?> 
    PHP Code:
    <?php
    $MailPassword 
    $row['Password'];

    ?>
    best regards
    Last edited by oesxyl; 03-16-2008 at 01:22 AM.

  • #3
    New Coder
    Join Date
    Mar 2008
    Posts
    35
    Thanks
    0
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by oesxyl View Post
    PHP Code:
    <?php
    $MailPassword 
    $row['Password'];

    ?>
    Hillary be praised.


  •  

    Posting Permissions

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