/[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.2 - (show annotations)
Fri Sep 28 23:34:37 2001 UTC (22 years, 6 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +13 -10 lines
Added some new pages to PLIVAmed. Some bugfixes.

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

  ViewVC Help
Powered by ViewVC 1.1.26