Jump to content

[SOLVED] cant get variable to work. seems so simple.


Reaper0167

Recommended Posts

The username does not appear. What is going on? This should be simple.

 

<?php
include "connection.php";

$user_in = $_POST['pin_find'];
$user_email = $_POST['email_find'];
$to = $user_email;
$subject = 'Username Request';
$headers = 'From: [email protected]' ;

$sql = "SELECT username FROM members WHERE secret_code = '$user_in' AND email = '$user_email' LIMIT 1";
$result = mysql_query($sql);
$count=mysql_num_rows($result);
$name = $result;

$message = "Thank you for being a member.  Your username is'" . $name . "'  Please do not respond to this email.";

if($count == 1)
{
    if(mail($to, $subject, $message, $headers)) 
//if(mail($to, $subject, $message, "$headers"))
    {
        echo "Email sent";
    }
    else 
    {
        echo "Email not sent";
    }
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.