---
title: "authentication not working in php file"  
description: "authentication not working in php file"  
author: "Anonymous User"  
published: 2013-05-02  
updated: 2013-05-02  
canonical: https://www.mindstick.com/forum/788/authentication-not-working-in-php-file  
category: "php"  
tags: ["php"]  
reading_time: 1 minute  

---

# authentication not working in php file

Hi Everyone!\
I have a login system, which [redirect](https://www.mindstick.com/forum/2005/radio-button-redirect) user to his [workplace](https://www.mindstick.com/articles/126352/how-video-games-are-changing-the-workplace) after login and i have set the logout button and to clear [session](https://www.mindstick.com/articles/12042/session-in-c-sharp) i have done this:\
This code check for session, which is created after login:\
this code in included in workplace area after login.\
**UPDATE 2:**\

```
 <?phprequire_once($_SERVER['DOCUMENT_ROOT'].'/ModelBase/connect/auth.php'); ?>
```

but after login ; i get this error when i upload it to host:\
Re-UPDATE 2: [Error after updating](https://answers.mindstick.com/qa/50819/how-to-fix-an-iphone-7-that-keeps-getting-wi-fi-error-after-updating-to-ios-11) require_once statement again:\
[Fatal error](https://answers.mindstick.com/qa/94996/how-do-i-fix-a-fatal-error-in-windows-10): require_once() [function.require]: Failed opening [required](https://www.mindstick.com/forum/160269/what-is-required-data-annotation-how-does-it-affect-model-validation) '/data/19/1/86/59/1901711/user/2069354/htdocs/xxxxxx/[connect](https://www.mindstick.com/articles/12810/how-to-connect-tablet-to-external-monitor-or-flat-screen-tv-using-computer-adapters)/auth.php' (include_path='.:/usr/[services](https://www.mindstick.com/articles/13111/distinctions-of-iiot-services-how-its-helps-brands)/vux/lib/php') in /data/19/1/86/59/1901711/user/2069354/htdocs/xxxxx/xxxxx/xxx/index.php on line 2 Found the solution myself.. Thanks everyone anyways..\
just was [missing](https://answers.mindstick.com/qa/52138/international-missing-children-s-day-2019-was-observed-on) 1 part of path folder and that fixed up all..\
NOTE: When i use this same [process](https://yourviews.mindstick.com/story/1525/7-important-factors-that-may-affect-the-learning-process) over localhost it never shows any error. what should i do ?\
Any help would be amazing thank you!

## Replies

### Reply by AVADHESH PATEL

Hi Jayprakash!\
\
you have error in include file path \
\
try as following \
\
require_once($_SERVER['DOCUMENT_ROOT'].'/ModelBase/connect/auth.php');\
\
I hope it resolve your problem


---

Original Source: https://www.mindstick.com/forum/788/authentication-not-working-in-php-file

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
