0

Folder

fb/fb-include.php

index.php

i was going to access my fb-include.php in my index.php and i have this line at my index page.

require_once('/fb/fb-include.php');

it work on my localhost wamp , but when i update to server , it wont work anymore.

i also try this

$root = realpath($_SERVER["DOCUMENT_ROOT"]);

require_once('$root/fb/fb-include.php');

what i did wrong ? is there any way i get into that folder still using require_once or should i use include ?

dee cheok
  • 257
  • 3
  • 17

1 Answers1

0

update your code like this

require_once $root.'/fb/fb-include.php';

or

require_once($root.'/fb/fb-include.php');

and need to sure root give your rootpath

or you can use like this

require_once('fb/fb-include.php')
Shafiqul Islam
  • 5,570
  • 2
  • 34
  • 43