0

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();
    }
}
?>
4

1 回答 1

1

文件末尾的空格可能会很痛苦。检查最后一个标签后是否有任何尾随回车或空格?>

于 2012-07-02T23:27:11.977 回答