Re: Das neue Auswendig lernen und die neuen UEbungen -

<?php
session_start ();
?>

<form method="POST" action="./form20240522.php">
<input type="text" name="form20240522a"></input>
<input type="submit"></input>
</form>

<?php
echo session_id () . "<br>n";

setcookie ("form20240522b", "Ich bin Cookie1", time () + 1200);

echo htmlentities (\$_POST ["form20240522a"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form20240522b"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form20240522c"]) . "<br>n";

session_destroy  ();
?>

Image 13DuWN0VSvIQd932kYC5jRSTHG9UT4VSj

Trying ::1...
Connected to localhost.
Escape character is '\^]'.
HTTP/1.1 200 OK
Date: Wed, 22 May 2024 07:22:43 GMT
Server: Apache/2.4.57 (Debian)
Set-Cookie: PHPSESSID=k3tmpin81guu05gaddcn4grkli; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: form20240522b=Ich%20bin%20Cookie1; expires=Wed, 22 May 2024 07:42:43 GMT; Max-Age=1200
Vary: Accept-Encoding
Content-Length: 217
Content-Type: text/html; charset=UTF-8


<form method="POST" action="./form20240522.php">
<input type="text" name="form20240522a"></input>
<input type="submit"></input>
</form>

k3tmpin81guu05gaddcn4grkli<br>
Ich bin das Datum<br>
<br>
Ich bin cookie 2<br>

POST http://localhost/mysql20240217/20240522/form20240522.php HTTP/1.1
host: localhost
Cookie: form20240522c=Ich bin cookie 2
Content-Length: 31
Content-Type: application/x-www-form-urlencoded

form20240522a=Ich bin das Datum

<?php
session_start ();

include ("/home/david/mysqldata.php");

\$db = new PDO ("mysql: host=localhost", \$MYSQL_USER, \$MYSQL_PASSWORD);

\$sql = "CREATE DATABASE mysql20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE mysql20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "CREATE TABLE a (x1 INTEGER, x2 INTEGER); CREATE TABLE b (y1 INTEGER, y2 INTEGER); ";
\$db->query (\$sql);

\$sql  = "INSERT INTO a (x1, x2) VALUES (0, 0); ";
\$sql .= "INSERT INTO a (x1, x2) VALUES (0, 1); ";
\$sql .= "INSERT INTO a (x1, x2) VALUES (1, 0); ";
\$sql .= "INSERT INTO a (x1, x2) VALUES (1, 1); ";
\$sql .= "INSERT INTO a (x1, x2) VALUES (2, 7); ";
\$sql .= "INSERT INTO b (y1, y2) VALUES (0, 1); ";
\$sql .= "INSERT INTO b (y1, y2) VALUES (1, 0); ";
\$sql .= "INSERT INTO b (y1, y2) VALUES (2, 7); ";
\$db->query (\$sql);

\$sql = "SELECT x1, x2 FROM a; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", " . \$row [1] . "; ";
echo "<br>n";

\$sql = "SELECT y1, y2 FROM b; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ",  " . \$row [1] . "; ";
echo "<br>n";

\$sql = "SELECT x1, x2, y1, y2 FROM a INNER JOIN b ON a.x1 = b.y1; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", " . \$row [1] . ", " . \$row [2] . ", " . \$row [3] . "; ";
echo "<br>n";

\$sql = "DROP DATABASE mysql20240522" . session_id () . "; ";
\$db->query (\$sql);

session_destroy ();
?>

0, 0; 0, 1; 1, 0; 1, 1; 2, 7; <br>
0,  1; 1,  0; 2,  7; <br>
0, 0, 0, 1; 0, 1, 0, 1; 1, 0, 1, 0; 1, 1, 1, 0; 2, 7, 2, 7; <br>

<?php
session_start ();

include  ("/home/david/mysqldata.php");

\$db = new PDO ("mysql: host=localhost", \$MYSQL_USER, \$MYSQL_PASSWORD);

\$sql = "CREATE DATABASE q20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE q20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "CREATE TABLE a (x INTEGER); CREATE TABLE b (x INTEGER); CREATE TABLE c (x INTEGER); ";
\$db->query (\$sql);

for (\$i = 0;  \$i < 24;  \$i++) {
    \$sql  = "INSERT INTO a (x) VALUES (" . rand () %  32 . "); ";
    \$sql .= "INSERT INTO b (x) VALUES (" . rand () %  64 . "); ";
    \$sql .= "INSERT INTO c (x) VALUES (" . rand () % 128 . "); ";
    \$db->query (\$sql);
}

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b UNION SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x
                INTERSECT
            SELECT x FROM c
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x
                UNION
            SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x
                INTERSECT
            SELECT x FROM b
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x
                UNION
            SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM b UNION SELECT x FROM c) x
                INTERSECT
            SELECT x FROM a
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x
                UNION
            SELECT x FROM (SELECT x FROM c INTERSECT SELECT x FROM a) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "DROP DATABASE q20240522" . session_id () . "; ";
\$db->query (\$sql);
session_destroy ();
?>
<?php
session_start ();

include  ("/home/david/mysqldata.php");

\$db = new PDO ("mysql: host=localhost", \$MYSQL_USER, \$MYSQL_PASSWORD);

\$sql = "CREATE DATABASE q20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE q20240522" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "CREATE TABLE a (x INTEGER); CREATE TABLE b (x INTEGER); CREATE TABLE c (x INTEGER); ";
\$db->query (\$sql);

for (\$i = 0;  \$i < 24;  \$i++) {
    \$sql  = "INSERT INTO a (x) VALUES (" . rand () %  32 . "); ";
    \$sql .= "INSERT INTO b (x) VALUES (" . rand () %  64 . "); ";
    \$sql .= "INSERT INTO c (x) VALUES (" . rand () % 128 . "); ";
    \$db->query (\$sql);
}

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b UNION SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM b) x
                INTERSECT
            SELECT x FROM c
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x
                UNION
            SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a UNION SELECT x FROM c) x
                INTERSECT
            SELECT x FROM b
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM b) x
                UNION
            SELECT x FROM (SELECT x FROM b INTERSECT SELECT x FROM c) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM b UNION SELECT x FROM c) x
                INTERSECT
            SELECT x FROM a
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "SELECT x FROM (
            SELECT x FROM (SELECT x FROM a INTERSECT SELECT x FROM c) x
                UNION
            SELECT x FROM (SELECT x FROM c INTERSECT SELECT x FROM a) x
    ) x ORDER BY x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

\$sql = "DROP DATABASE q20240522" . session_id () . "; ";
\$db->query (\$sql);
session_destroy ();
?>

13, 8, 5, 29, 9, 22, 4, 12, 18, 28, 17, 11, 30, 10, 0, 20, 15, 27, 46, 54, 50, 38, 43, 57, 32, 36, 40, 16, 59, 48, 34, 42, <br>
13, 8, 5, 29, 9, 22, 4, 12, 18, 28, 17, 11, 30, 10, 0, 20, 15, 27, 70, 44, 107, 94, 106, 68, 63, 97, 114, 36, 118, 2, 53, 14, 41, 122, 21, 6, 46, 51, <br>
12, 46, 54, 50, 38, 43, 57, 29, 32, 36, 40, 16, 59, 48, 5, 13, 27, 34, 17, 42, 70, 44, 107, 94, 106, 68, 63, 97, 114, 118, 2, 53, 14, 41, 122, 21, 6, 8, 51, <br>
13, 5, 29, 12, 17, 27, <br>
8, <br>
46, 36, <br>
8, 36, 46, <br>
8, 36, 46, <br>
5, 12, 13, 17, 27, 29, 36, 46, <br>
5, 12, 13, 17, 27, 29, 36, 46, <br>
5, 8, 12, 13, 17, 27, 29, <br>
8, <br>

#!/bin/bash

if [[ "\$1" == "David" \&amp;\&amp; "\$2" == "Vajda" ]]
then
    echo  "Das bin ich"
elif [[ "\$1" ==  "David Vajda" \&amp;\&amp; -z "\$2"  ]]
then
    echo "Das  bin  ich"
elif  [[ "\$1"  == "David" \&amp;\&amp; -z "\$2" ]]
then
    echo "Das bin ich"
elif [[ "\$1" == "Vajda" \&amp;\&amp; -z "\$2" ]]
then
    echo "Das koennte ich sein"
elif [[ -n "\$1" ]]
then
    echo "Das bin ich nicht"
else
    echo "Hallo Welt"
    i = 0
    while [ \$i -lt 10 ]
    do
        echo  "Hallo zum \$((\$i+1))."
        i=\$((\$i+1))
    done
    a=(Aber hallo sage ich)
    a+=(und das auch)

    i=0
    while [ \$i -lt 7 ]
    do
        echo "\${a[\$i]}"
        i=\$((\$i+1))
    done

    for s in "\${a[@]}"
    do
        echo "\$s"
    done

    l=\$(ls)
    for s in \$l
    do
        echo "\$s"
    done
fi