A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876
a - mcpaste
<?php // UTF-8 marker äöüÄÖÜ߀
require_once './Page.php';
class index extends Page
{
private $defaultwahl;
private $anzahl;
protected function __construct() {
parent::__construct();
// to do: instantiate members representing substructures/blocks
}
protected function __destruct() {
parent::__destruct();
}
protected function getViewData() {
$defaultwahl = 1;
$SQLabfrage1 = "SELECT * FROM bilder ORDER BY challange DESC ";
$SQLabfrage2 = "SELECT * FROM bilder WHERE challange = '$defaultwahl'";
$Recordset = $this->database->query ($SQLabfrage1);
if (!$Recordset)
throw new Exception("Keine Challanges gefunden");
if ($Recordset){
// Benoetigte Eintraege für HTML-Ausgabe auslesen
$Record = $Recordset->fetch_assoc();
$anzahl = $Record ["challange"];
}
$Recordset = $this->database->query ($SQLabfrage2);
if (!$Recordset)
throw new Exception("Keine Challanges gefunden");
$bilder = array();
$bild = array();
if ($Recordset){
// Benoetigte Eintraege für HTML-Ausgabe auslesen
$Record = $Recordset->fetch_assoc();
while ($Record) {
$bild["bild"] = $Record["src"];
$bild["votes"] = $Record["votes"];
$bild["id"] = $Record["id"];
$uploader = $Record["uploader"];
$bilder[$uploader] = $bild;
$Record = $Recordset->fetch_assoc();
}
$Recordset->free();
}
return $bilder;
}
protected function generateView() {
$bilder = $this->getViewData();
$this->generatePageHeader('Gimpfight');
echo <<<EOT
<h1>GIMPBATTLE</h1>
<form>
<div name = "sel"> <select name = "challangeauswahl" size ="5" >
EOT;
for($i = 1; $i <= $anzahl; $i++){
echo "<option>$i</option>";
}
echo <<<EOT
</select></div>
</form>
EOT;
$test = array();
$test["id"] = 0;
$test["bild"] = "pic.bmp";
$test["votes"] = 0;
$links = array();
$rechts = array();
$r = rand(0, 1);
if($r == 0){
$links = $bilder["tobi"];
$rechts = $bilder["benny"];
}
else{
$links = $bilder["benny"];
$rechts = $bilder["tobi"];
}
echo <<<EOT
<form action = "index.php" method = "post">
<div name= links style="float:left>
EOT;
$id = $links['id'];
$pic = $links['bild'];
$votes = $links['votes'];
echo <<<EOT
<input id="in" type= "hidden" value="$id">;
<img src="$pic" alt="bildlinks" width =33% height = 33%/>
<label for ="linkssub">$votes<label>
<button type=submit id=linkssub>
</div>
</form>
EOT;
$id = $rechts['id'];
$pic = $rechts['bild'];
$votes = $rechts['votes'];
echo <<<EOT
<form action = "index.php" method = "post">
<div name= rechts style="float:right">
<input id="in" type= "hidden" value=$id>
<img src="$pic" alt="bildrechts"/ width =33% height = 33%>
<label for ="rechtssub">$votes<label>
<button type=submit id="rechtssub">
</div>
</form>
EOT;
$this->generatePageFooter();
}
protected function processReceivedData() {
parent::processReceivedData();
$this->defaultwahl = 0;
$this->anzahl = 0;
// Aufruf prüfen:
if (isset($_POST["in"]) && isset($_POST["in"])) {
// Aufruf durch Formular
$id = $_POST["in"];
$SQLabfrage = "SELECT * FROM bilder WHERE id = '$id'";
$Recordset = $this->database->query ($SQLabfrage);
$Record = $Recordset->fetch_assoc();
$count = $Record["count"];
$Recordset.free();
$count = $count +1;
$SQLabfrage = "INSERT INTO bilder SET count = '$count'";
$this->database->query ($SQLabfrage);
}
}
public static function main() {
try {
$page = new index();
$page->processReceivedData();
$page->generateView();
}
catch (Exception $e) {
header("Content-type: text/plain; charset=UTF-8");
echo $e->getMessage();
}
}
}
index::main();
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}
A PHP Error was encountered
Severity: 8192
Message: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
Filename: database/DB_driver.php
Line Number: 1876