Help - Search - Members - Calendar
Full Version: Require Not Working...
Zymic Webmaster Forums > Zymic Free Web Hosting > Zymic Free Web Hosting - General Discussion & Help
moonlight2889
I've created a file named louie.php then inserted a code
CODE
<? echo "I should see this!"; ?>

just to see if php is working
( NOT WORKING ON OTHER SITES TOOOOOOOOOT! )...

when I was able to run the script... i created another directory named coresClass
then uploaded a class named coresMysql.php ( database connection ).
so the file is in coresClass/coresMysql.php

after that, i went back to file manager and edited louie.php added a line on top of the DTD thing... like
CODE
<?php
require "coresClass/coresMysql.php";

?>


so i was actually including the class i've created... it works fine on my computer but when i uploaded it to any site hosting...
it gives me error and this is what i always got!

require(coresClass/coresMysql.php) [function.require]: failed to open stream: No such file or directory in /www/vndv.com/c/o/r/cores/htdocs/louie.php on line 2

and

Fatal error: require() [function.require]: Failed opening required 'coresClass/coresMysql.php' (include_path='.:/usr/lib/php') in /www/vndv.com/c/o/r/cores/htdocs/louie.php on line 2

this is the actual code...

CODE
<?php
require "coresClass/coresMysql.php";

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>

Louie Bacani Foronda;
<?php
echo "I should see this?";

?>
</body>
</html>



HOPING FOR A POSITIVE ANSWER! THANKS!
swordz
Try require "./coresClass/coresMysql.php";

It may work...

Swordz
moonlight2889
QUOTE(swordz @ Sep 29 2009, 10:20 PM) *
Try require "./coresClass/coresMysql.php";

It may work...

Swordz



it still doesn't work...
now i got 3 errors...

added:


Warning: require() [function.require]: Unable to access ./coresClass/coresMysql.php in /www/vndv.com/c/o/r/cores/htdocs/louie.php on line 2

why is it not able to access the file?...

Jacob
CODE
<? echo "I should see this!"; ?>

Should be:
CODE
<?php
echo "Text here";
?>

Using <? ?> instead of <?php ?> is lazy and can cause issues on some servers.

And try
CODE
<?php
require("coresClass/coresMysql.php");
?>

And see if that helps.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.