samedi 15 mai 2021

PHP header not redirecting (used ob_start, ect!) [duplicate]

<?php
    ob_start();
    require("inc/connect.inc");
    if(!empty($_POST)){
        $email = "'" . $_POST["email"] . "'";
        $pass = $_POST["password"];
        $sql = "SELECT * FROM iBayMembers WHERE email=$email";
        $res =& $dbs->query($sql)->fetchRow();
        $passAcc = $res[1];
        if($pass == $passAcc){
            ob_clean();
            header("Location:www.google.com", true, 301);
            exit();
       }
    }
?>

I have done and tried everything that was suggested, including exit(), ob_flush(), ob_clean() ect. I see it returns the HTML of my page (www.google.com is just an example for this question) in console of Google dev tools, but the page is staying as is.




Aucun commentaire:

Enregistrer un commentaire