forgot password script
Posted: Mon Jul 08, 2002 12:54 pm
I'm working on making a simple page that emails members their passwords if they forget them. (After they put their email in a form and hit submit)
I'm really trying to figure this one out on my own, so for now i just want to print the search result (which will be the user's password) from a fairly simple mysql query. Now, this isn't how I'm going to actually do this. I just want to know that i'm retrieving the data from the db correctly. This is the code I came up with, the form self submits, and it is echoing out "resource ID # 3", and I have no idea why it would do this. Here's the php code atop the self-submitting form
I'm really trying to figure this one out on my own, so for now i just want to print the search result (which will be the user's password) from a fairly simple mysql query. Now, this isn't how I'm going to actually do this. I just want to know that i'm retrieving the data from the db correctly. This is the code I came up with, the form self submits, and it is echoing out "resource ID # 3", and I have no idea why it would do this. Here's the php code atop the self-submitting form
Code: Select all
<?php
include("webvars.php");
if (isset($submit)) {
mysql_connect($hostname, $user, $pass)
or die ("the site database is down.");
mysql_select_db("pancorp");
$sql = "SELECT password FROM technicians WHERE email = '$email'";
$result = mysql_query($sql) or die("The database is down.");
$getresult = mysql_query($sql);
echo ("$getresult");
}
?>