Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js "></script>
</head>
<body>
<form method="GET" id ="mytarget" action="/myanotherpage.php"></form>
<?php
session_start();
$_SESSION['mysession'] = "mysession"; // set a session
if(!isset($_SESSION['mysession'])) { // check if the session exists
echo'<script type="text/javascript">$(document).ready(function(){$("#mytarget").submit();});</script>'; // redirect to the another page
exit;
}
?>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP Click to see more ... 4.6K 408