Here comes the code... I've been looking after wrong $'s for ages..
I hope it shows up good...
<?php
//
// Keuze tussen welke types nieuws
//
?>
<?php
//
// Output van alle artikels
//
include("../includes/connect.php");
$sql = "SELECT * FROM nieuws_artikels";
$query = mysql_query($sql) or die("Fout. " . mysql_error());
while($result = mysql_fetch_array($query)) {
$id = $result["id"];
$titel = $result["nieuws_titel"];
$onderwerp = $result["nieuws_onderwerp"];
echo "$id $titel $onderwerp <br>";
}
//
// Toevoegen
//
if($act = toevoegen) {
if($type = 1) { // SPELER
if(!empty($titel)) {
$nieuws_onderwerp = addslashes($nieuws_onderwerp);
$nieuws_titel = addslashes($nieuws_titel);
$nieuws_begin = addslashes($nieuws_begin);
$nieuws_tekst = addslashes($nieuws_tekst);
$nieuws_bron = addslashes($nieuws_bron);
$nieuws_bronlink = addslashes($nieuws_bronlink);
$nieuws_archief = addslashes($nieuws_archief);
$nieuws_datum = addslashes($nieuws_datum);
$match = addslashes($match);
$match_video = addslashes($match_video);
$match_verslag = addslashes($match_verslag);
$match_reacties = addslashes($match_reacties);
$intern = addslashes($intern);
$hits = addslashes($hits);
$sql = "INSERT INTO nieuws_artikels SET id='$id', type='$type', nieuws_onderwerp='$nieuws_onderwerp', nieuws_titel='$titel' archief='1' intern='$intern'";
$query = mysql_query($sql) or die("Fout. " . mysql_error());
echo "Artikel toegevoegd!";
} else {
?>
<form name="spelernieuws" method="post" action="<?php echo $PHP_SELF; ?>">
Speler: <input type="text" name="nieuws_onderwerp"><br>
Titel: <input type="text" name="titel"><br>
Inleiding: <textarea name="begin"></textarea><br>
Tekst: <textarea name="tekst"></textarea><br>
Bron: <input type="text" name="bron"><br>
Link: <input type="text" name="bronlink"><p>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
} elseif($type = 2) { // MATCH
if(!empty($titel)) {
$nieuws_onderwerp = addslashes($nieuws_onderwerp);
$nieuws_titel = addslashes($nieuws_titel);
$nieuws_begin = addslashes($nieuws_begin);
$nieuws_tekst = addslashes($nieuws_tekst);
$nieuws_bron = addslashes($nieuws_bron);
$nieuws_bronlink = addslashes($nieuws_bronlink);
$nieuws_archief = addslashes($nieuws_archief);
$nieuws_datum = addslashes($nieuws_datum);
$match = addslashes($match);
$match_video = addslashes($match_video);
$match_verslag = addslashes($match_verslag);
$match_reacties = addslashes($match_reacties);
$intern = addslashes($intern);
$hits = addslashes($hits);
$sql = "INSERT INTO nieuws_artikels SET type='$type', match='$match', match_video='$match_video', match_verslag='$match_verslag', match_reacties='$match_reacties', nieuws_titel='$titel', nieuws_begin='$begin', archief='1' intern='$intern'";
$query = mysql_query($sql) or die("Fout.<br>" . mysql_error());
echo "Artikel toegevoegd.";
} else {
?>
<form name="matchnieuws" method="post" action="<?php echo $PHP_SELF; ?>">
Match: <input type="text" name="match"><br>
Titel: <input type="text" name="titel"><br>
Inleiding: <textarea name="begin"></textarea><br>
Matchverslag online: <input type="text" name="match_verslag"><br>
Video match al online: <input type="text" name="match_video"><br>
Reacties al online: <input type="text" name="match_reacties"><br>
<input type="submit" name="Submit" value="Submit">
</form>
<?php
}
} elseif($type = 3) { // ALLE ANDERE ARTIKELS
if(!empty($titel)) {
$nieuws_onderwerp = addslashes($nieuws_onderwerp);
$nieuws_titel = addslashes($nieuws_titel);
$nieuws_begin = addslashes($nieuws_begin);
$nieuws_tekst = addslashes($nieuws_tekst);
$nieuws_bron = addslashes($nieuws_bron);
$nieuws_bronlink = addslashes($nieuws_bronlink);
$nieuws_archief = addslashes($nieuws_archief);
$nieuws_datum = addslashes($nieuws_datum);
$match = addslashes($match);
$match_video = addslashes($match_video);
$match_verslag = addslashes($match_verslag);
$match_reacties = addslashes($match_reacties);
$intern = addslashes($intern);
$hits = addslashes($hits);
$sql = "INSERT INTO nieuws_artikels SET type='$type', nieuws_onderwerp='$nieuws_onderwerp', nieuws_begin='$nieuws_begin', nieuws_tekst='$nieuws_tekst', nieuws_bron='$nieuws_bron', nieuws_bronlink='$nieuws_bronlink', nieuws_archief='1', nieuws_datum='$nieuws_datum', intern='$intern'";
$query = mysql_query($sql) or die("Fout.<br> " . mysql_error());
echo "Artikel toegevoegd!";
} else {
?>
<form name="andereartikels" method="post" action="<?php echo $PHP_SELF; ?>">
Onderwerp: <input type="text" name="nieuws_onderwerp"><br>
Titel: <input type="text" name="titel"><br>
Inleiding: <textarea name="begin"></textarea><br>
Tekst: <textarea name="tekst"></textarea><br>
Bron: <input type="text" name="bron"><br>
Link: <input type="text" name="bronlink"><br>
Intern: <input type="text" name="intern">
</form>
<?php
}
}
?>