I want to redirect to login page to previous page.I've tried many ways to make it work but I didn't. When I echo I can see on browser and it works properly. However, when I try to redirecting but I can't.
**login.page**
<?php
if ($row = mysqli_fetch_array($result)) {
$url = $_SERVER['HTTP_REFERER'];
$url2 =parse_url( $url, PHP_URL_QUERY);
header("Location: $_SERVER["HTTP_REFERER"]");
}
?>
**main.php**
<?php
if (!isset($_SESSION['id'])) {
<a id='' href=' https://www.example.com/login.php>
<input type='submit' name='send' i class='btn-basic value='write'></a>
}
?>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…