I'm posting this here because I really don't know of any other forums, and I'm too lazy to look for one
Are there any PHP guru's out there that can help?
Here's the code. If there's any other info you need, just ask.
CODE
<?
session_start();
include 'db.php';
switch($_POST['change']){
default:
include 'new_pw.php';
break;
case "change":
change_pw($_POST['password']);
break;
}
function change_pw($password){
if(!$password){
echo "Please enter in a valid password.<br />";
include 'new_pw.php';
exit();
}
$db_password = md5($password);
$sql = mysql_query("UPDATE users SET password='$db_password' WHERE userid='$userid'");
$subject = "Your Password at Tasmo.org!";
$message = "Hi, you have recently changed your password.
Username: $userid
New Password: $password
Thanks!
Tasmo.org Staff
This is an automated response, please do not reply!";
mail($email_address, $subject, $message, "From: Tasmo.org<admin@tasmo.org>\nX-Mailer: PHP/" . phpversion());
echo "Your password has been changes successfully.<br />";
include 'login_u.php';
}
?>
session_start();
include 'db.php';
switch($_POST['change']){
default:
include 'new_pw.php';
break;
case "change":
change_pw($_POST['password']);
break;
}
function change_pw($password){
if(!$password){
echo "Please enter in a valid password.<br />";
include 'new_pw.php';
exit();
}
$db_password = md5($password);
$sql = mysql_query("UPDATE users SET password='$db_password' WHERE userid='$userid'");
$subject = "Your Password at Tasmo.org!";
$message = "Hi, you have recently changed your password.
Username: $userid
New Password: $password
Thanks!
Tasmo.org Staff
This is an automated response, please do not reply!";
mail($email_address, $subject, $message, "From: Tasmo.org<admin@tasmo.org>\nX-Mailer: PHP/" . phpversion());
echo "Your password has been changes successfully.<br />";
include 'login_u.php';
}
?>
Thanks,
Johnny