Redirect link is not working after loggin in in php


I want to make that after logging in to website(default7test.php), it has to open the default8 link. But it is not opening and still default7test.php link is still remaining. What I want to make is If I open the default7.test.php, it has to open default8.html link automatically.

    $loginname = '';
    $stsiteuser = '';
    $email = '';
    $usrgrp = '';
    $stldap = '';
    session_set_cookie_params(0, '/', '');
    session_start(['read_and_close' => true]);
    if (isset($_SESSION["loginname"])) { 
        $loginname = $_SESSION["loginname"];
        $email = $_SESSION["email"];
        $stsiteuser = $_SESSION["stsiteuser"];
        $usrgrp = $_SESSION["usrgrp"];
        $badgeno = $_SESSION["badgeno"];
        //echo "LDAP: ".$ldapbadge;
    if ($usrgrp == "999998") {
        echo "<tr><td class=\"left_padding\"><a class=info href=\"\" target=\"_blank\"></a></td></tr>";
    $imgnm = Array();
    $count = 0;

    echo "<html>\n";
    echo "<head><title>SGEWS Homepage</title>\n";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"\web/css/apewsmain.css\"/>\n";
    echo "<script src=\"\web/js/apews/apewsjs.js\" type=\"text/javascript\"></script>";
    //for instant search on main page --- isaac
    echo "<script type=\"text/javascript\" src=\"\web/js/apews/jquery/jquery-1.3.2.js\"></script>";
    echo "<script type=\"text/javascript\" src=\"\web/js/apews/search.js\"></script>";
    //for slideshow --- isaac
    echo "<script type=\"text/javascript\" src=\"\web/js/apews/jquery.cycle.js\"></script>";
    echo "<script type=\"text/javascript\" src=\"\web/js/apews/slideshow.js\"></script>";
    //for instant search on main page --- isaac
    echo "<script type=\"text/javascript\" src=\"\web/js/apews/main.js\"></script>";
    //include( "//");
    include( "//");
    include ("ip_control7.php");

Above page is default7test.php.

<!DOCTYPE html>
<html lang="en">

    <meta charset="utf-8" />

    <div>Redirecting SGEWS Page to Microsoft Edge</div>
    <script type="text/javascript">
        function detectbrowser() {
            var ua = window.navigator.userAgent;
            if (ua.indexOf("Edg") > 0) { //Edge
                window.location = "";
            } elseif (ua.indexOf("Trident") > 0 || ua.indexOf("Chrome") > 0) { //IE or Chrome
                window.location = ("microsoft-edge:");


Above page is default8.html that I made for redirect.


<a> tag will not redirect unless you click it, you should try header('Location:'); in your php code in default7test.php to make redirect to 8.

Answered By – bubbak

Answer Checked By – Clifford M. (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.