after sending data into DB stays on the same on the same page , please help
[php]
if(isset($_POST[‘submit’])){
$stmt = $connection->prepare("INSERT INTO advert (title, email, phone, place, options, name, lastname, message, kod , image, rodzaj, cena, ip) VALUES (?, ?, ?,?, ?, ?,?, ?, ?,?, ?, ?,?)");
$stmt->bind_param(“sssssssssbsss”, $title, $email, $phone, $place, $options, $user, $lastname, $message, $randomString, $file, $rodzaj, $cena, $ip);
$user=$_SESSION['login'];
$title=filter_var($_POST[‘title’], FILTER_SANITIZE_STRING);
$email=filter_var($_POST[‘email’], FILTER_SANITIZE_STRING);
$phone=filter_var($_POST[‘phone’], FILTER_SANITIZE_STRING);
$place=filter_var($_POST[‘place’], FILTER_SANITIZE_STRING);
$options=filter_var($_POST[‘options’], FILTER_SANITIZE_STRING);
$lastname=filter_var($_POST['powiat'], FILTER_SANITIZE_STRING);
$message=filter_var($_POST['message'], FILTER_SANITIZE_STRING);
$rodzaj=filter_var($_POST['optradio'], FILTER_SANITIZE_STRING);
$cena=filter_var($_POST['cena'], FILTER_SANITIZE_STRING);
$length = 10;
$randomString = substr(str_shuffle(“0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”), 0, $length);
$ip=$_SERVER[“REMOTE_ADDR”];
$file = addslashes(file_get_contents($_FILES[“image”][“tmp_name”]));
$stmt->execute();
$formcontent=" From: $imie \n Email: $email \n Wiadomosc: $message \n Kod: $randomString \n ";
$recipient = “$email”;
$mailheader = “From: $email \r\n”;
mail($recipient, $mailheader, $formcontent ) or die("Error!");
header(“Location: addimages.php”);
}
$stmt->close();
}
[/php]