rendered paste body<?php
error_reporting(E_ALL);
include "config.php";
if(isset($_GET['img.x'])){
$naam = $_GET['naam'];
$populatie = $_GET['populatie'];
$land = $_GET['land'];
$x = $_GET['img.x'];
$y = $_GET['img.y'];
mysql_query("INSERT INTO steden(naam,populatie,land,x,y) VALUES('$naam','$populatie','$land','$x','$y')");
echo "Stad succesvol toegevoegd!";
}
if(empty($_POST['land'])&& empty($_GET['land'])){
?>
<form action="vstad.php?a=a" method="post">Naam:<BR><input name="naam" type="text" size="20" maxlength="20"><BR>Populatie:<BR><input name="populatie" type="text" size="9" maxlength="9"><BR>Land:<BR><select name="land">
<?PHP
$query = mysql_query("SELECT * FROM landen");
while($land = mysql_fetch_assoc($query)){
echo "<option value='".$land['id']."'>".$land['naam']."</option>";
}
?>
</select><BR><input name="submit" type="submit" value="Voegtoe"></form>
<?php
}
else{
echo "<form action=\"vstad.php\" method=\"GET\">
<input name=\"land\" type=\"hidden\" value=\"".$_POST['land']."\"><input name=\"naam\" type=\"hidden\" value=\"".$_POST['naam']."\"><input name=\"populatie\" type=\"hidden\" value=\"".$_POST['populatie']."\">
<input type=\"image\" name=\"img\" src=\"europe_politiqueniew1.jpg\" />
</form>";
}
?>