I have a php page that allows the user to input some data, and tries to put them into a database. However, my header is not working. It runs the query, but stops at the header, and displays a blank page. Can someone help me out?
<?php
if(isset($_POST['submit'])) {
$user_id = $_POST['user_id'];
$user_vcode = $_POST['user_vcode'];
$send_data = true;
if(empty($user_id) || empty($user_vcode)){
$send_data = false;
}
if($send_data){
require("../../db.php");
$account_id = $_COOKIE['account_id'];
$query = "INSERT INTO api (key_id, key_vcode, owner_id) VALUES ('$user_id', '$user_vcode', '$account_id')";
$result = mysqli_query($dbc, $query) or die("Failed querying database");
mysqli_close($dbc);
header("Location: http://www.google.com");
die();
}
}
?>