1

I have a question.

I have file1.php in includes directory - so includes/file1.php Another file is file2.php that have a

require(dirname(__FILE__).'/includes/file1.php');

I've looked with firebug, and also I wrote something into a txt file, and seem

Shakti Singh
  • 84,385
  • 21
  • 134
  • 153
user760821
  • 21
  • 2

2 Answers2

3
require_once(dirname(__FILE__).'/includes/file1.php');

The require_once() statement is identical to require() except PHP will check if the file has already been included, and if so, not include (require) it again.

Shakti Singh
  • 84,385
  • 21
  • 134
  • 153
0

If you see that a page is loaded twice in your client, i.e. in Firefox (or Firebug), you're code does most likely redirect or something like that.

It would be good to see a part of the code here, or at least what exactly you're seeing in Firebug (like HTTP actions / status codes).

Koraktor
  • 41,357
  • 10
  • 69
  • 99