Re: Aufgaben und UEbungen,

Image Screenshot_20240309_190347

<?php
session_start ();
?>

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

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

setcookie ("form2024030902", "Ich bin Cookie 1", time () + 1200);

echo htmlentities (\$_POST ["form2024030901"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form2024030902"]) . "<br>n";
echo htmlentities (\$_COOKIE ["form2024030903"]) . "<br>n";

session_destroy ();
?>

POST http://localhost/mysql20240217/20240309/form20240309.php HTTP/1.1
host: localhost
Cookie: form2024030903=Hallo ich bin das zweite Cookie
Content-Length: 38
Content-Type: application/x-www-form-urlencoded

form2024030901=Hallo ich bin das Datum

Trying ::1...
Connected to localhost.
Escape character is '\^]'.
HTTP/1.1 200 OK
Date: Sat, 09 Mar 2024 18:17:57 GMT
Server: Apache/2.4.57 (Debian)
Set-Cookie: PHPSESSID=0ab4vp5g1buk6p4fkcus36c2it; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: form2024030902=Ich%20bin%20Cookie%201; expires=Sat, 09 Mar 2024 18:37:57 GMT; Max-Age=1200
Vary: Accept-Encoding
Content-Length: 239
Content-Type: text/html; charset=UTF-8


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

0ab4vp5g1buk6p4fkcus36c2it<br>
Hallo ich bin das Datum<br>
<br>
Hallo ich bin das zweite Cookie<br>

<?php
session_start ();

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

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

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

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

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

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

\$sql = "INSERT INTO a (x1, x2) VALUES (0, 0); ";
\$db->query (\$sql);

\$sql = "INSERT INTO a (x1, x2) VALUES (0, 1); ";
\$db->query (\$sql);

\$sql = "INSERT INTO a (x1, x2) VALUES (1, 0); ";
\$db->query (\$sql);

\$sql = "INSERT INTO a (x1, x2) VALUES (1, 1); ";
\$db->query (\$sql);

\$sql = "INSERT INTO b (y1, y2) VALUES (0, 1); ";
\$db->query (\$sql);

\$sql = "INSERT INTO b (y1, y2) VALUES (1, 0); ";
\$db->query (\$sql);

\$sql = "INSERT INTO a (x1, x2) VALUES (2, 7); ";
\$db->query (\$sql);

\$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] . "<br>n";
echo "<br>n";

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

\$sql = "DROP DATABASE mysql20240309" . 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 d20240309" . session_id () . "; ";
\$db->query (\$sql);

\$sql = "USE d20240309" . 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 < 18;  \$i++) {
    \$sql = "INSERT INTO a (x) VALUES (" . rand () % 24 . "); INSERT INTO b (x) VALUES (" . rand () % 32 . "); INSERT INTO c (x) VALUES (" . rand () % 18 . "); ";
    \$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; ";
\$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; ";
\$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; ";
\$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 c INTERSECT SELECT x FROM b) x
    ) 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;";
\$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 INTERSECT SELECT x FROM a) x
                UNION
            SELECT x FROM (SELECT x FROM c INTERSECT SELECT x FROM a) x
    ) x; ";
\$stmt = \$db->query (\$sql);
while (\$row = \$stmt -> fetch ())
    echo \$row [0] . ", ";
echo "<br>n";

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

session_destroy ();
?>

17, 13, 23, 22, 20, 7, 15, 19, 5, 18, 12, 1, 11, 3, 24, 25, 14, 30, 2, 29, 27, 10, 8, <br>
17, 13, 23, 22, 20, 7, 15, 19, 5, 18, 12, 1, 11, 6, 4, 10, 8, 2, <br>
3, 24, 1, 13, 25, 14, 30, 2, 29, 17, 27, 23, 10, 8, 6, 4, 5, 12, 11, 7, 15, <br>
17, 13, 23, 1, <br>
17, 13, 7, 15, 5, 12, 1, 11, <br>
1, 13, 2, 17, 10, 8, <br>
17, 13, 7, 15, 5, 12, 1, 11, 2, 10, 8, <br>
17, 13, 7, 15, 5, 12, 1, 11, 2, 10, 8, <br>
17, 13, 23, 1, 10, 8, 2, <br>
17, 13, 23, 1, 10, 8, 2, <br>
1, 13, 17, 23, 5, 12, 11, 7, 15, <br>
1, 13, 17, 23, 5, 12, 11, 7, 15, <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 koennte ich sein"
elif [[ "\$1" == "Vajda" \&amp;\&amp; -z "\$2" ]]
then
    echo "das koennte ich sein"
elif [ -n "\$1" ]
then
    echo "das bin ich nicht"
else
    i=0
    while [ \$i -lt 10 ]
    do
        echo "Hallo zum \$((\$i+1))."
        i=\$((\$i+1))
    done
    a=(Aber hallo sage ich)
    a+=(Genau das sage ich)
    i=0
    while [ \$i -lt 8 ]
    do
        echo "\${a[\$i]}"
        i=\$((\$i+1))
    done
    for s in "\${a[@]}"
    do
        echo "\$s"
    done
    echo "Hallo Welt"
    l=\$(ls)
    for s in \$l
    do
        echo "\$s"
    done
fi

Hallo zum 1.
Hallo zum 2.
Hallo zum 3.
Hallo zum 4.
Hallo zum 5.
Hallo zum 6.
Hallo zum 7.
Hallo zum 8.
Hallo zum 9.
Hallo zum 10.
Aber
hallo
sage
ich
Genau
das
sage
ich
Aber
hallo
sage
ich
Genau
das
sage
ich
Hallo Welt
addressdecodertestbench.c
alldo.txt
alllinks.sh
allpdf.sh
a.out
asd
ASM
asm15
asm16
aus
auslesen01
auswendig20240308a.txt
auswendig20240308.txt
auswendig20240309a.txt
automat15
automat15.c
bash20240309.out
bash20240309.sh
Bilder
binary2
binary20240305.txt
binary2.c
binomialkoeffizient.asm
deepsearch1
deepsearch1.c
deepsearch2
deepsearch2.c
document.pdf
Dokumente
Downloads
eeprom.hex
facebookpassword.txt
float.c
fsmprogs
generatetestbench2
generatetestbench3
generatetestbench4
generatetestbench5
gheim
gnu-hello
inst
intel-schluesselworte-1.jpg
intel-schluesselworte-2.jpg
intel-schluesselworte-3.jpg
intel-schluesselworte-4.jpg
intel-schluesselworte-5.jpg
intel-schluesselworte-6.jpg
intel-schluesselworte-7.jpg
intel-schluesselworte.pdf
lcd-routines.asm
mail
Mars
mips32singlecycle2.vhdl
mips32singlecycle.vhdl
mult.asm
multdiv.c
Musik
mylcd.asm
mylcd.eep.hex
mylcd.hex
mylcd.obj
mysqldata.php
names.txt
node_modules
OEffentlich
password
password46.txt
pc.txt
Prog-Express_Manual_German.pdf
quine
savesql.txt
save.txt
Schreibtisch
Screenshot_20240307_133445.png
Screenshot_20240307_134123.png
Screenshot_20240307_140606.png
Screenshot_20240308_055818.png
Screenshot_20240308_172537.png
Screenshot_20240309_190347.png
state3
svg
test.png.vcd
todo2.txt
todo.txt
Videos
VirtualBox
VMs
Vorlagen
wave.ghw
work-obj93.cf
z80.txt