Ok I have been working on this script and I have came across a snag. It seems to always goto message delivery failed can someone point me in the right direction on what I did wrong or where the error is. Thanks in advance.
Code:
<?php
$h = "HOST";
$u = "USER";
$p = "PASSWORD";
$d = "LOGON";
$s = "Password Retrieval";
$i = $_POST['email'];
if( !isset($i) )
{
print '<form action="retreivepass.php" method="post">
<table><tr><td>Email:
</td><td><input type="text" name="email" maxlength="32">
</td></tr></table>
<input type="submit" value="Submit">
</form>';
}
else
{
@mysql_connect($h, $u, $p) or die("Unable to connect to server.");
@mysql_select_db($d) or die("Unable to connect to database.");
$o = @mysql_query("SELECT `login`,`password`,`email` FROM `accounts` WHERE `email` LIKE ".$i);
$r = @mysql_fetch_assoc($o);
$name = $r['login'];
$email = $r['email'];
$pass = $r['password'];
$b = $name.',\n\nYour password on the account is <b>'.$pass.'</b>\n\nThankYou,\nDPS-WoW';
if (mail($email, $s, $b))
{
echo("<p>Message successfully sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
}
?>