Fixed the above problem. Next problem is in the source code, when I try to add something, it doesn't. My source code so far:
<?
if(!session_id()){
session_start(); }
if (isset ($_POST['password'])){
$_SESSION['password'] = $_POST['password']; }
if (isset ($_SESSION['password'])){
$password = $_SESSION['password'];
$link = mysql_connect("localhost", "tuningcenter", $password)
or die("" . session_unset() . "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=admin.php\">");
if (isset ($_GET['action']))
{
$action = $_GET['action'];
if ($action == 'add'){ echo "<form action=\"admin.php?action=do_add\" method=\"post\" name=\"add\" id=\"add\">
<p align=\"center\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">Type Product<br>
<select name=\"typeprod\" id=\"typeprod\">
<option value=\"Velgen\">Velgen</option>
<option value=\"Spoilers\">Spoiler</option>
<option value=\"Grills\">Grill</option>
<option value=\"Blaat\" selected>Nog aanvullen</option>
</select>
<br>
<br>
Fabrikant<br>
<input name=\"fab\" type=\"text\" id=\"fab\">
<br>
<br>
Model<br>
<input name=\"model\" type=\"text\" id=\"model\">
<br>
<br>
Korte omschrijving:<br>
<textarea name=\"desc\" id=\"desc\"></textarea>
<br>
<br>
<input name=\"Add\" type=\"submit\" id=\"Add\" value=\"Toevoegen\">
</font></p>
</form>";
exit; }
elseif ($action == 'do_add'){ $sqladd = mysql_query("INSERT INTO producten (" . $_POST['typeprod'] . ") VALUES ('" . $_POST['fab'] . "', '" . $_POST['model'] . "', '" . $_POST['desc'] . "')");
echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=admin.php\">";
exit; }
elseif ($action == 'edit'){ }
elseif ($action == 'del'){ }
}
echo "<p><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><strong>TuningCenter Database Administratie</strong></font></p>
<p><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">Kies een optie:</font></p>
<ol>
<li><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><a href=\"admin.php?action=add\">Artikel toevoegen</a></font></li>
<li><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><a href=\"admin.php?action=edit\">Artikel wijzigen</a></font></li>
<li><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><a href=\"admin.php?action=del\">Artikel verwijderen</a></font></li>
</ol><br><br><b><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">Klaar met de administratie ? <form action=\"admin.php\" method=\"post\" name=\"logout\" id=\"logout\">
<input name=\"logoff\" type=\"submit\" id=\"logoff\" value=\"Afmelden\"></form> <font color=\"red\">(Echt Afmelden ! Venster sluiten is niet voldoende !)</font></font></b>"; }
else {
?>
<p><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Inloggen</font></strong></p>
<form name="form1" method="post" action="admin.php">
<font size="-1" face="Verdana, Arial, Helvetica, sans-serif">Wachtwoord: </font>
<input name="password" type="password" id="password">
<input type="submit" name="Submit" value="Login">
</form>
<p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"></font></p>
<?
}
if (isset ($_POST['logoff']))
{
if ($_POST['logoff'] == 'Afmelden')
{
$password = $_SESSION['password'];
$link = mysql_connect("localhost", "tuningcenter", $password)
or die("" . session_unset() . "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=admin.php\">");
mysql_close($link);
session_unset();
echo "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=admin.php\">";
}
}
?>
As you can see I havn't implemented edit and del funtions yet, will do that later, first I need some help with adding new stuff to the database. Any ideas here ?