Page 1 of 1

strange require_once dont load file.

Posted: Tue Jan 15, 2008 1:06 pm
by FreeAngel
Hello,

I have a strange problem I work on windows system.

I have files and Folders in my project like this

root(folder) - auth(folder) - validate.php
- includes - include.php

in validate.php i need to load include.php so I have there a code

Code: Select all

 
<?php
require_once('../includes/include.php');
 
echo "Hello, world";
?>
 
this should work bcs it works well in other project but here it dont work

when I load validate.php in browser it should load include.php and write onscreen "Hello, world" but nothing happens

So I am asking if someone know what should be the problem?

thx to all replies

Re: strange require_once dont load file.

Posted: Tue Jan 15, 2008 1:23 pm
by RobertGonzalez
Turn on error reporting and display errors and see what PHP is telling you.

Code: Select all

<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
 
// And now the rest of your code
?>

Re: strange require_once dont load file.

Posted: Tue Jan 15, 2008 1:47 pm
by FreeAngel
thank you for advice.

I found it, problem solved.

Re: strange require_once dont load file.

Posted: Tue Jan 15, 2008 2:08 pm
by RobertGonzalez
Generally speaking when you get a blank page it is because of some error that causes parsing to abort. Setting error_reporting to an appropriate level and actually displaying the error output will almost always help you find the trouble.