N
N
Nikita Podosenov2020-02-07 12:26:03
PHP
Nikita Podosenov, 2020-02-07 12:26:03

Why is the cookie not being created?

I read the documentation, searched the Internet, but did not understand: why is the file not being created, although it should?

for ($j = 0 ; $j < $rows ; ++$j)
            {
                $result->data_seek($j);
                $row = $result->fetch_array(MYSQLI_ASSOC);
                if($name==$row['имя'] && $surname==$row['фамилия'] && $password==$row['пароль'])
                {
                    $id=$row['id'];
                    setcookie("TestCookie", $id, time()+3600); 
                    echo "<script>document.location.href='../hiPage/hiPage.php'</script>";
                }
            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Just OK, 2020-02-07
@olejkaok

At the very beginning of the page write ob_start();
I also came across this hat)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question