Example #1
0
 public function __construct()
 {
     $_dbConf = CApp::app()->getConf('Db');
     $_Dbs = array();
     if (!$_dbConf) {
         return NULL;
     }
     foreach ($_dbConf as $identify => $conf) {
         switch (!empty($conf['lib'])) {
             case 1:
                 $LibClass = 'C' . ucfirst(strtolower($conf['lib']));
                 $_Dbs[$identify] = $this->_Dbs[$identify] = $LibClass::createDb($conf);
             default:
                 $_Dbs[$identify] = $this->_Dbs[$identify] = CMysql::createDb($conf);
                 break;
         }
     }
     $this->_DbConf = array_shift($_dbConf);
     return !empty($this->_Dbs) ? $this->_Db = array_shift($_Dbs) : NULL;
 }
    $password = $_REQUEST['password'];
} else {
    print "<html><body>Fout: geen wachtwoord opgegeven<BR></body></html>\n";
    exit;
}
#if ($bottomcmd == "logout")
# {
#  unset($_SESSION['uid']);
#  unset($_SESSION['pwd']);
#
#  $_SESSION = array();
#  session_destroy();
#  //include("http://localhost/php/login.html");
#  exit;
# }
$mysql = new CMysql();
$mysql->connect($hostname, $mysql_user, $mysql_pass);
$mysql->usedb($dbname);
$mysql->set_main_table($main_table);
$mysql->set_main_form($main_form);
#$mysql->set_coll_cns($coll_cns);
mysql_select_db($dbname) or die("Kan database {$dbname} niet openen");
$query = "SELECT wedstrijd_id,password,is_aktief,is_locked,naam FROM wedstrijd WHERE wedstrijd_id = '" . $competition_nr . "' AND password = '" . $password . "' AND is_aktief = '1' AND is_locked = '0' LIMIT 1";
print "query: {$query}<BR>";
$result = $mysql->query($query);
$number = mysql_numrows($result);
if ($number == 0) {
    print "<html><body>Fout: wedstrijd met nummer {$competition_nr} en opgegeven wachtwoord niet gevonden, of upload niet (meer) toegestaan<BR></body></html>\n";
    exit;
}
print "<html>";