0

i have a login system, which redirect user to his workplace after login and i have set the logout button and to clear session 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:

 <?php
require_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 require_once statement again:

Fatal error: require_once() [function.require]: Failed opening required '/data/19/1/86/59/1901711/user/2069354/htdocs/xxxxxx/connect/auth.php' (include_path='.:/usr/services/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 1 part of path folder and that fixed up all..

NOTE: When i use this same process over localhost it never shows any error. what should i do ?

devilcrab
  • 141
  • 4
  • 21
  • 1
    one server is windows.... other one is linux. – itachi May 02 '13 at 06:48
  • Try to provide `DOCUMENT_ROOT` and then give full path – Dipesh Parmar May 02 '13 at 06:49
  • Does the file "/data/19/1/86/59/1901711/user/2069354/htdocs/MainProject/xxxxxx/connect/auth.php" exist? – David Houde May 02 '13 at 06:49
  • @DavidHoude Yes that exists ! – devilcrab May 02 '13 at 06:50
  • That's the reason we use `require_once` so we can have a error if something goes wrong in getting the file. So just check the error , debug & solve it !! – Rikesh May 02 '13 at 06:51
  • See itachi's comment, and change ..\connect\auth to ../connect/auth – David Houde May 02 '13 at 06:51
  • @DavidHoude i have done that..changed the format.. but still new error. – devilcrab May 02 '13 at 06:55
  • @devilcrab - Update your question with code you have tried. – Rikesh May 02 '13 at 06:56
  • Updated, please have a look. – devilcrab May 02 '13 at 06:59
  • `require_once($_SERVER['DOCUMENT_ROOT'].'/ModelBase/connect/auth.php');` Dude do some basic debugging! – itachi May 02 '13 at 07:05
  • i can't -1 it but due to 125 rep restriction or i would have... :\ i told its not working.. read before posting ! – devilcrab May 02 '13 at 07:08
  • here is the error that i get next when i do that: Fatal error: require_once() [function.require]: Failed opening required '/data/19/1/86/59/1901711/user/2069354/htdocs/xxxxxx/connect/auth.php' (include_path='.:/usr/services/vux/lib/php') in /data/19/1/86/59/1901711/user/2069354/htdocs/xxxxx/xxxxx/xxx/index.php on line 2 – devilcrab May 02 '13 at 07:08
  • itachi already raised the issue. But is it possible you named the file Auth.php (capital letter?). Your home server might be Windows wich is case-insensitive and your server is linux (which is case sensitive). – Hugo Delsing May 02 '13 at 07:50

2 Answers2

1

you have error in include file path try

require_once($_SERVER['DOCUMENT_ROOT'].'/ModelBase/connect/auth.php');
Rakesh Sharma
  • 13,680
  • 5
  • 37
  • 44
0

Change this line:

require_once('$_SERVER['DOCUMENT_ROOT']./ModelBase/connect/auth.php');

To:

require_once($_SERVER['DOCUMENT_ROOT'].'/ModelBase/connect/auth.php');

Done:)

Dharmesh Patel
  • 1,881
  • 1
  • 11
  • 12