I'll try to be as specific as possible, but it is quite hard, since I don't have a clue on what going on. So when I insert values into my "input", and hit the submit button, my php pages goes to a php register page (since my input uses "post"), then sent back again with javascript:
<script>
window.open("Addmovie.php?tittel=","_self")
</script>
But when it gets sent back my pages goes to the same "URL" but it displayed a nearly blank page, with only the Norwegian word for "hi", my Input gets registered, but if I refresh the page, even with shift+f5 it still doesn't show anything. If I go to another page on my website, and then go back again, I can see that my Input got registered. I assume the "Hi" part comes from my provider when nothing shows seeing as I have encountered this message before in unrelated ways.
My input on the site/how it supposed to look
the page I get back to, after I hit submit
Where I really get confused, is that I have been able to input values to my database before, it is just now I get blank back. I could post my code, but I don't know what part to post.
The input file regarding the registerlooks like this:
<html>
<head>
</head>
<body>
<h3>Add a movie</h3>
<form action="movieregister.php" method="post" enctype="multipart/form-data">
<p>
<label>Title: </label><input type="text" name="tittel">
</p>
<p>
<label>Year: </label><input type="text" name="aar">
</p>
<p>
<label>Genre: </label><input type="text" name="genre">
</p>
<p>
<label>Description: </label>
<br><textarea rows="5" <input type="text" name="plot"></textarea>
</p>
<p>Select image to upload:
<input type="file" name="fileToUpload" id="fileToUpload">
</p>
<input type="submit">
</form>
</body>
</html>
My register:
<?php
else {
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)||$tittel==""||$aar==""||$genre==""||$plot=="") {
$db=mysqli_connect("$host","$user","$database","$password","$port");
$sql="INSERT INTO gruppe3_film (tittel, aar, genre, plot) VALUES ('$tittel','$aar','$genre','$plot')";
$result=mysqli_query($db,$sql);
echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
$db->close()
?>
<script>
window.open("Addmovie.php?tittel=","_self")
</script>
Please ask away if you want/need some information. Thanks for any answers in advance.