Beispiel #1
0
 function insertMember($host, $user, $pass, $database, $table)
 {
     $query = "INSERT INTO {$table} (ime,prezime,adresa,postnum,mjesto,telefon,email,skola,clan,auto,izlet,majica,boja,velicina,user,password) VALUES ('{$this->ime}', '{$this->prezime}', '{$this->adresa}', '{$this->brojPoste}', '{$this->mjesto}', '{$this->telefon}', '{$this->email}', '{$this->skola}', '{$this->clan}', '{$this->auto}', '{$this->izlet}', '{$this->majica}', '{$this->boja}', '{$this->velicina}', '{$this->username}', '" . md5($this->password) . "')";
     try {
         $conn = new mysqlConnection($host, $user, $pass, $database);
         $conn->open();
         mysql_query($query);
         $success = true;
         $conn->close();
         unset($conn);
     } catch (Exception $e) {
         echo $e->getMessage();
         $success = false;
     }
     return $success;
 }
Beispiel #2
0
            unset($sudionik);
            echo "<SCRIPT LANGUAGE='javascript'>window.alert ('Prijava uspje¹no izvr¹ena! Na email koji ste unijeli stiæi æe vam ostale upute.'); window.open('index.php','_self');</SCRIPT>";
        } else {
            unset($sudionik);
            echo "<SCRIPT LANGUAGE='javascript'>window.alert ('Gre¹ka prilikom prijave!'); window.open('index.php','_self');</SCRIPT>";
        }
        $tip = NULL;
        break;
    case "login":
        $username = $_REQUEST["txtUserName"];
        $password = $_REQUEST["txtPassword"];
        $conn = new mysqlConnection($dbhostname, $dbusername, $dbpassword, $dbname);
        $conn->open();
        if (!validateLoginData($username, $password, $conn->dbconnection)) {
            echo "<SCRIPT LANGUAGE='javascript'>window.alert ('Pogre¹no upisani podaci ili niste prijavljeni na skup!'); window.open('index.php','_self');</SCRIPT>";
            $conn->close();
            unset($conn);
        } else {
            if (isAdmin($username)) {
                $query = "SELECT ime, prezime, adresa, postnum, mjesto, telefon, email, skola, clan, auto, izlet, majica, boja, velicina, user FROM " . $dbtbl;
                $result = mysql_query($query);
                if (mysql_num_rows($result) <= 0) {
                    $conn->close();
                    unset($conn);
                    echo "<SCRIPT LANGUAGE='javascript'>window.alert ('Nema zapisa!');window.open('index.php','_self');</SCRIPT>";
                } else {
                    echo '
					<html>
					<head>
					<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
					<link rel="stylesheet" type="text/css" href="css/style.css" />