/[health_html]/inc/pgRegistracija.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

Diff of /inc/pgRegistracija.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ravilov, Tue Oct 2 16:18:09 2001 UTC revision 1.6 by ravilov, Sat Oct 27 16:54:50 2001 UTC
# Line 80  Line 80 
80                  if (!$nesto && !$spec_0) $error |= 32;                  if (!$nesto && !$spec_0) $error |= 32;
81                  if (!$username) { $userok = true; $error |= 64; }                  if (!$username) { $userok = true; $error |= 64; }
82                  if ($username) {                  if ($username) {
83                          $sql = "SELECT user_id FROM users WHERE (username = '$username')";                          $sql = "SELECT username FROM users WHERE (username = '$username')";
84                          $sth = $dbh->prepare($sql);                          $sth = $dbh->prepare($sql);
85                          if (!$sth) error("Cannot prepare query: \"$sql\"");                          if (!$sth) error("Cannot prepare query: \"$sql\"");
86                          if (!$sth->execute()) error("Cannot execute query: \"$sql\"");                          if (!$sth->execute()) error("Cannot execute query: \"$sql\"");
# Line 107  Line 107 
107                          $drzava = $drzava ? my_quote($drzava) : "NULL";                          $drzava = $drzava ? my_quote($drzava) : "NULL";
108                          $sql = "INSERT INTO users (titula, ime, prezime, email, zanimanje, godrod, ustanova, adresa, mjesto, drzava, newsletter, promo, username, password) VALUES ($titula, $ime, $prezime, $email2, $zanimanje, $godrod, $ustanova, $adresa, $mjesto, $drzava, ".($newsletter?"true":"false").", ".($promo?"true":"false").", $username2, '".md5($password1)."')";                          $sql = "INSERT INTO users (titula, ime, prezime, email, zanimanje, godrod, ustanova, adresa, mjesto, drzava, newsletter, promo, username, password) VALUES ($titula, $ime, $prezime, $email2, $zanimanje, $godrod, $ustanova, $adresa, $mjesto, $drzava, ".($newsletter?"true":"false").", ".($promo?"true":"false").", $username2, '".md5($password1)."')";
109                          $dbh->dbh_do($sql);                          $dbh->dbh_do($sql);
                         $sql = "SELECT currval('users_user_id_seq')::text";  
                         $sth = $dbh->prepare($sql);  
                         if (!$sth) error("Cannot prepare query: \"$sql\"");  
                         if (!$sth->execute()) error("Cannot execute query: \"$sql\"");  
                         $row = $sth->fetchrow_array();  
                         $sth->finish();  
                         $row = array_shift($row);  
110                          for ($i = 0; $i < count($specs); $i++) {                          for ($i = 0; $i < count($specs); $i++) {
111                                  if ($specs[0]["checked"]) continue;                                  if ($specs[0]["checked"]) continue;
112                                  if (!$specs[$i]["checked"]) continue;                                  if (!$specs[$i]["checked"]) continue;
113                                  if ($specs[$i]["id"] == 0) continue;                                  if ($specs[$i]["id"] == 0) continue;
114                                  $sql = "INSERT INTO user_spec (user_id, spec_id) VALUES ($row, ".$specs[$i]["id"].")";                                  $sql = "INSERT INTO user_spec (username, spec_id) VALUES ('$username2', ".$specs[$i]["id"].")";
115                                  $dbh->dbh_do($sql);                                  $dbh->dbh_do($sql);
116                          }                          }
117                          $mail = "                          $mail = "

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.26