GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Another way to include a php file? (https://gfy.com/showthread.php?t=501572)

Jace 08-09-2005 12:57 PM

Another way to include a php file?
 
i have this code I need to insert into my site:

<?
include "/directory/of/file/public_html/cnstats/cnt.php";
?>

but when I do insert it creates some bad mysql errors.....is there a way to include this another way other than the way I have shown above?

mortenb 08-09-2005 12:59 PM

include("path/to/file"); and require("path/to/file");

but it is unlikely that the way you are including has anything to do with your mysql errors.. it is more likely what is in the included file..

AcidMax 08-09-2005 01:01 PM

You have to look at the other file too. It seems like it is accessing a mysql database, maybe with another include that has mysql functions?

You could also try.

chdir('/path/to/known/working/dir');
include('./path/to/the/file');
chdir('/current/directory/');

Machete_ 08-09-2005 01:01 PM

It should work, I do the same on my one site.
just put the relative (NOT absolute) path to it

So if your indes is located in the root, and the cnt.php is located in the subfolder root/cnstats
then it should look like this:

<?
include "cnstats/cnt.php";
?>

Jace 08-09-2005 01:03 PM

it has something to do with b2evolution

everything works fine, except when someone is trying to access a url_that_looks_like_this....every other thing works, and the one thing that allows those urls to work again is removing that php code from cnstats

Jace 08-09-2005 01:04 PM

Quote:

Originally Posted by ebus_dk
It should work, I do the same on my one site.
just put the relative (NOT absolute) path to it

So if your indes is located in the root, and the cnt.php is located in the subfolder root/cnstats
then it should look like this:

<?
include "cnstats/cnt.php";
?>

nope, that didn't work

Jace 08-09-2005 01:06 PM

Quote:

Originally Posted by AcidMax
include('./path/to/the/file');

that did it ;)

thanks!

AcidMax 08-09-2005 01:15 PM

Quote:

Originally Posted by JaceXXX
that did it ;)

thanks!


Glad it helped.


All times are GMT -7. The time now is 12:17 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123