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.
$foo = true;
if($foo === true){
echo "Foo is true";
}elseif($foo != true){
echo "Foo is not true";
}else{
echo "Foo is nothing";
}
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once "inc/include.html";
$blogid = ((!empty($_GET['id'])) ? $_GET['id'] : '' );
if(mysqli_error($DB)){
echo 'Fehler: ' . mysqli_error($DB);
}else{
if (isset($_POST['submit']) && isset($_POST['name']) && isset($_POST['mail'])&&
isset($_POST['inhalt']) && $_POST['name'] != '' && $_POST['mail'] != '' &&
$_POST['inhalt'] != '') {
$sql =
"
INSERT INTO
comments
SET
inhalt='{$_POST['inhalt']}',
date=NOW(),
blogid=$blogid,
email='{$_POST['email']}',
name='{$_POST['name']}'
";
$result = mysqli_query($DB, $sql);
echo 'SQL: ' . $sql;
echo mysqli_error($DB);
}
$sql = "
SELECT
blogid,
DATE_FORMAT(date,'%d.%m.%Y, %H:%I') as date,
inhalt,
name
FROM `comments`
WHERE blogid =".(int)$blogid;
if(!$DB_result = $DB->query($sql))
{
echo 'Fehler('.$DB->errno.'):'.$DB->error;
}else
{
while($row = mysqli_fetch_array($DB_result))
{
echo "<div class=\"comments\">";
echo "<ul>";
echo "<li> Kommentar von ".$row['name']." am ".$row['date']." Uhr </li>";
echo "<li>".$row['inhalt']."</li>";
echo "</ul>";
echo "</div>";
}
}
}
$DB->close();
?>
INSERT INTO
comments
SET
inhalt='{$_POST['inhalt']}',
date=NOW(),
blogid=$blogid,
email='{$_POST['email']}',
name='{$_POST['name']}'
INSERT INTO
comments
(inhalt,date,blogid,email,name)
VALUES('".$_POST['inhalt']."','NOW()','".$_POST['email']."','".$_POST['name']."')
$sql =
"
INSERT INTO
comments
(inhalt,date,blogid,email,name)
VALUES('{$_POST['inhalt']}', NOW(), '$blogid', '{$_POST['email']}', '{$_POST['name']}')";
110506 11:07:08 4 Connect root@localhost on bloggen
4 Query SELECT
id,
DATE_FORMAT(date,'%d.%m.%Y, %H:%I') as date,
autor,
title,
content,
bild
FROM `entrys`
WHERE id =3
4 Query SELECT
blogid,
DATE_FORMAT(date,'%d.%m.%Y, %H:%I') as date,
inhalt,
name
FROM `comments`
WHERE blogid =3
110506 11:07:09 4 Quit
110506 11:07:43 5 Connect root@localhost on bloggen
5 Query SELECT
id,
DATE_FORMAT(date,'%d.%m.%Y, %H:%I') as date,
autor,
title,
content,
bild
FROM `entrys`
WHERE id =0
5 Query SELECT
blogid,
DATE_FORMAT(date,'%d.%m.%Y, %H:%I') as date,
inhalt,
name
FROM `comments`
WHERE blogid =0
5 Quit