Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mdzwolf

macrumors member
Original poster
Oct 13, 2005
36
5
Hey everyone, I am trying to create a php site and the first part is a user login system. I wrote the database functions and put them in a seperate file called MySQL.php and I am trying to use require_once to include the file. However whenever I use the require_once, require, or include command the script doesn't execute it just loads to a blank page and doesn't even show any html or the document title. As soon as I comment out that line it works fine, such as showing the result of phpinfo() and any html in the document. I am totally lost as to why this is. Below is how I have the lined coded:

require_once('./database/mysql.php');

Here is how the code is written:

PHP:
<?php
require_once('./database/mysql.php');

phpinfo();
?>


<html>
<body>
hey
</body>
</html>

Any help would be greatly appreciated!
 
thejadedmonkey said:
use " instead of ' in the include/require

That'll make no difference in this case.

A blank screen usually means there's a parse error on the page. Look in the PHP error log (or webserver error log, depending on your server and settings) and you'll find the error message there. the code you quoted looked fine, so you'll probably find the error in the included file.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.