Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
if( mysql_num_rows($result) != 1 ) {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true);
exit;
}
Warning: imagecreatefrompng(.png): failed to open stream: No such file or directory in \htdocs\sigs\gumbo.php on line 29
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in \htdocs\sigs\gumbo.php on line 30
etc...
<?php
include 'config.php';
if (isset($_REQUEST["Submit"])) {
header('Content-Type: image/png');
$name = $_REQUEST["name"];
$conn_id = mysql_connect($host,$user,$pw);
mysql_select_db($database,$conn_id);
$query = '
SELECT
`car`,
`name`,
`points`,
`poles`,
`win`,
`posi`
FROM
`$table`
WHERE
`name = '.$name.'`
';
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
$car = $row['car'];
$nick = $row['name'];
$points = $row['points'];
$poles = $row['poles'];
$win = $row['win'];
$posi = $row['posi'];
}
$img = imagecreatefrompng(''.$car.'.png');
$bl = imagecolorallocate($img, 0, 0, 0);
$we = imagecolorallocate($img, 255, 255, 255);
$ro = imagecolorallocate($img, 255, 0, 0);
imagestring($img, 2, 320, 95, $nick, $we);
imagestring($img, 2, 20, 15, "Poles: ".$poles, $we);
imagestring($img, 2, 20, 30, "Siege: ".$win, $we);
imagestring($img, 2, 20, 45, "Punkte: ".$points, $we);
imagestring($img, 2, 20, 80, "Position: ".$posi, $ro);
imagepng($img);
imagedestroy($img);
}
?>
<?php
include 'config.php';
if( !isset($_REQUEST['name']) || empty($_REQUEST['name']) ) {
header($_SERVER['SERVER_PROTOCOL'].' 412 Precondition Failed', true);
exit;
}
$conn_id = mysql_connect($host, $user, $pw);
mysql_select_db($database, $conn_id);
$query = '
SELECT
`car`,
`name`,
`points`,
`poles`,
`win`,
`posi`
FROM
`'.mysql_real_escape_string($table).'`
WHERE
`name` LIKE "'.mysql_real_escape_string($_REQUEST['name']).'"
LIMIT
1
';
$result = mysql_query($query)
// Nachfolgendes zur einfachen Fehlerdiagnose
or die(mysql_error());
if( mysql_num_rows($result) != 1 ) {
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true);
exit;
}
$row = mysql_fetch_assoc($result);
$im = imagecreatefrompng($row['car'].'.png');
$white = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 4, 320, 95, $row['name'], $white);
imagestring($im, 4, 20, 15, 'Poles: '.$row['poles'], $white);
imagestring($im, 4, 20, 30, 'Siege: '.$row['win'], $white);
imagestring($im, 4, 20, 45, 'Punkte: '.$row['points'], $white);
imagestring($im, 4, 20, 80, 'Position: '.$row['posi'], $white);
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>