<?
if (isset($Submit)) {
include ("config.php");
mysql_connect("$DbHost", "$DbUser", "$DbPassword");
mysql_select_db("$DbDatabase");
$sql = "INSERT INTO `beurs` (`ipadres`, `naam`, `emailadres`, `tracker`, `functie`) VALUES ('$ipadres', '$naam', '$emailadres', '$tracker', '$functie')";
mysql_query($sql);
mysql_close();
// Kijken of de velden zijn ingevuld
if ($ipadres == "") {
print "Je hebt geen (geldig) ipadres opgegeven...";
print "<br><a href=\"javascript:history.go(-1)\">Ga terug</a> en vul dit in.";
exit;
}
echo"De info is toegevoegd aan de database...";
echo"<br><a href=\"javascript:history.go(-2)\">Ga terug</a> naar de overzichtpagina.";
} else {
?>
<html>
<head>
<title>Staff Overzicht</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<body bgcolor="#FEF1C0">
<form action="" method="post" enctype="multipart/form-data" name="form1">
<table width="74%" border="1" align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="18%">Ipadres:</td>
<td width="15%" rowspan="6"> </td>
<td width="63%"><input name="ipadres" type="text" id="ipadres"></TD>
<td width="4%"></td>
</tr>
<tr>
<td><strong>Naam:</strong></td>
<td><input name="naam" type="text" id="naam">
gebruikersnaam indien bekend</td>
</tr>
<tr>
<td><strong>Emailadres:</strong></td>
<td><input name="emailadres" type="text" id="emailadres">
</td>
</tr>
<tr>
<td><strong>Tracker:</strong> </td>
<td><input name="tracker" type="text" id="tracker">
Volledige tracker URL</td>
</tr>
<tr>
<td><strong>Functie:</strong></td>
<td><input name="functie" type="text" id="functie" >
Functie als stafflid</td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="2" align="right"><input name="Submit" type="submit" id="Submit" value="Verzenden"></td>
<td>
<input name="Submit2" type="reset" id="Submit2" value="Wissen"></td>
</tr>
</table>
</form>
<? } ?>
</body>
</html>
946 views
Ik heb een probleem met een script. Dit script moet gegevens in de database zetten, maar doet dat niet. Wanneer ik handmatig in de database gegevens invoer, dan laat hij ze wel zien op de pagina. Dus wat zit er fout in dit script, dat hij geen gegevens plaatst in de database