How can i fix this issue

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
helloimjah
New php-forum User
New php-forum User
Posts: 8
Joined: Sat Apr 18, 2020 3:55 pm

Sun Jul 19, 2020 8:22 am

Hello, i have build website with login/register

in each page there is security.php include

security.php{

if (!everythingIsOkay){
exit(header('Location: /admin/login'));
}
}
job.php{
ajax{
GET: job-feed.php
Response: do stuff
},5000)
}
job-feed.php{
include security.php
Stuff that is being returned to job.php
}

thing is, it makes get requests to page every X seconds, when client information is fine it's okay, if client logs out in other tab and job-feed is being requested it should be redirected to login by security.php script

instead it doesn't redirect me but adds login page html into job.php page, and page looks mixed

How can i redirect parent page from child script, i have already tried using die but with no results
Post Reply