#9 så skal du da heller ikke have sid med over i url'en til opretspiller2.php, da det er der du opretter sid
så skal denne
<form action = "opretspiller2.php?sid=<?php echo $sid; ?>" method="POST">
laves om til det gamle
<form action = "opretspiller2.php" method="POST">
i opretspiller2.php laver du så bare en header location, som jakobdo skrev i
https://www.computerworld.dk/eksperten/spm/1017481?k=8259908$result = $con->query($sql);
$sid = $con->insert_id;
echo "mit id er: ";
echo $sid;
laves om til
$result = $con->query($sql);
$sid = $con->insert_id;
header("Location: spiller.php?sid=" . $sid);
exit();
nb:
ref
http://php.net/manual/en/function.header.phpRemember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.