strange require_once dont load file.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
FreeAngel
Forum Newbie
Posts: 4
Joined: Tue Jan 15, 2008 5:46 am

strange require_once dont load file.

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: strange require_once dont load file.

Post 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
?>
FreeAngel
Forum Newbie
Posts: 4
Joined: Tue Jan 15, 2008 5:46 am

Re: strange require_once dont load file.

Post by FreeAngel »

thank you for advice.

I found it, problem solved.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: strange require_once dont load file.

Post 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.
Post Reply