Bij deze code wordt steeds het eerste if-statement uitgevoerd, ook al
is de ($_GET["plekje"])waarde niet overeenkomsitg :s .
Dit is de code :
----------------------------------------------
if (empty($_POST)){
// eerst controleren of pagina wel is aangeroepen vanuit formulier
echo("Vul eerst <a href=\"fromtoevoegenstanden.html\">gegevens
voor de werknemer</a> in");
exit();
}else{
if ($_GET["plekje"] ="één")
{
$stand =$_POST['fstand'];
$datum =$_POST['fdatum'];
$sql="INSERT INTO water3 (stand,datum)
VALUES ('$stand','$datum')";
mysql_query($sql) or die ("can't execute query.");
$query = $_POST["fstand"] ."', '" ;
$query .= $_POST["fdatum"] ."', '" ;
}
elseif ($_GET["plekje"] = "twee")
{
$stand =$_POST['fstand'];
$datum =$_POST['fdatum'];
$sql="INSERT INTO water2 (stand,datum)
VALUES ('$stand','$datum')";
mysql_query($sql) or die ("can't execute query.");
$query = $_POST["fstand"] ."', '" ;
$query .= $_POST["fdatum"] ."', '" ;
}
elseif ($_GET['plekje'] = "drie")
{
$stand =$_POST['fstand'];
$datum =$_POST['fdatum'];
$sql="INSERT INTO water1 (stand,datum)
VALUES ('$stand','$datum')";
mysql_query($sql) or die ("can't execute query.");
$query = $_POST["fstand"] ."', '" ;
$query .= $_POST["fdatum"] ."', '" ;
}
}
------------------------------------------------------------------------------
Dus wanneer de ($_GET['plekje']) waarde gelijk is aan drie, wordt toch
de eerste if-statement uitgevoerd.

Likes:

Quote
