/[health_html]/inc/pgPrijava-zaboravio.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /inc/pgPrijava-zaboravio.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Wed Sep 26 13:04:28 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
Added some missing files, and some missing features...

1 <?php
2 $error = "";
3 if ($posalji) {
4 include("inc/conn.php");
5 $sql = "SELECT email FROM users WHERE (username = '$username')";
6 $sth = $dbh->prepare($sql);
7 if (!$sth) error("Cannot prepare query: \"$sql\"");
8 if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
9 $email = $sth->fetchrow_array();
10 $sth->finish();
11 if ($email) $email = array_shift($email);
12 if (!$email) $error = "Nepoznato korisnièko ime.";
13 if (!$error) {
14 $pass = GeneratePassword();
15 $sql = "UPDATE users SET password = '".md5($pass)."' WHERE (username = '$username')";
16 $dbh->dbh_do($sql);
17 $error = mail($email, "PLIVAmed.net - Registracija", "\nNova lozinka: $pass\n", "From: registracija@plivamed.net") ? "" : "Gre¹ka prilikom slanja e-mail poruke.";
18 }
19 }
20 $tpl->assign("username", $username);
21 $tpl->assign("error", $error);
22 $tpl->assign("done", $error ? false : true);
23 ?>

  ViewVC Help
Powered by ViewVC 1.1.26