# Email Password. This should work

**URL:** <https://forum.kirupa.com/t/email-password-this-should-work/166631>\
**Category:** programming\
**Created:** [October 21, 2005, 1:48pm UTC](https://forum.kirupa.com/t/email-password-this-should-work/166631 "2005-10-21T13:48:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Templarian](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/templarian/32/7152_2.png) [@Templarian](https://forum.kirupa.com/u/Templarian)\
**Post date:** [October 21, 2005, 1:48pm UTC](https://forum.kirupa.com/t/email-password-this-should-work/166631/1 "2005-10-21T13:48:04Z")

</div>

fpass.php:

```php
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM test WHERE user='$first'";
$result=mysql_query($query);
$num=mysql_num_rows($result); 
mysql_close();
$i=0;
while ($i < $num) {
$user=mysql_result($result,$i,"user");
$pass=mysql_result($result,$i,"pass");
$email=mysql_result($result,$i,"email");
}

$to = . $HTTP_POST_VARS['$email'];
$subject = "Templarian Studios: Password Recovery";
$body .= "Username:" . $HTTP_POST_VARS['$user'] . ">
";;
$body .= "Password: " . $HTTP_POST_VARS['$pass'] . ">
";
$header .= "X-Mailer: PHP/" . phpversion() . "
";
$header .= "X-Priority: 1";
?>

```

this would email the link when this url was called:

[www.domain.com/fpass.php?user=usernamehere](http://www.domain.com/fpass.php?user=usernamehere)
