Seruvs,
hab ein problem mit folgendem Script
die Seite wird nicht neu geladn obwohl header('Location: newslogin.php'); gesetzt ist
woran liegt das?
hab ein problem mit folgendem Script
PHP:
<form method="post" action="newslogin.php">
<select name="eintrag">
<option>Neu</option>
<?php
for($i = 1; $i <= $anzahl; $i++){
echo "<option>".$i."</option>";
}
?>
</select>
<select name="was">
<option>Eintrag</option>
<option>Löschen</option>
<option>Ändern</option>
</select><br>
<input type="text" name="betreff"><br>
<textarea name="text"></textarea><br>
<input type="submit" name="submit"><input type="reset">
</form>
<?php
$time = time();
$uhr = date("H:i",$time);
$datum = date("d.m.y",$time);
$eintrag = mysql_real_escape_string($_POST["eintrag"]);
$was = mysql_real_escape_string($_POST["was"]);
$betreff = mysql_real_escape_string($_POST["betreff"]);
$text = mysql_real_escape_string($_POST["text"]);
if(isset($_POST["submit"])){
if($was == "Eintrag"){
$eintrag = "INSERT INTO `news` (`uhrzeit`,`datum`,`betreff`,`text`) VALUES ('".$uhr."','".$datum."','".$betreff."','".$text."')";
$query = mysql_query($eintrag);
header('Location: newslogin.php');
}else{
if($was == "Löschen"){
$loeschen = "DELETE FROM `news` WHERE `id` = '5'";
$loeschung = mysql_query($loeschen) or DIE("FEHLER");
neuladen();
}else{
echo "Ändern";
}
}
}
die Seite wird nicht neu geladn obwohl header('Location: newslogin.php'); gesetzt ist
woran liegt das?