Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-09-2005, 12:57 PM   #1
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
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?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 12:59 PM   #2
mortenb
Confirmed User
 
mortenb's Avatar
 
Join Date: Jul 2004
Location: Denmark ICQ: 7880009
Posts: 2,203
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..
mortenb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:01 PM   #3
AcidMax
Confirmed User
 
Join Date: May 2002
Location: MI
Posts: 1,827
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/');
__________________
Latest MMA news. http://www.mmawrapup.com
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:01 PM   #4
Machete_
WINNING!
 
Industry Role:
Join Date: Oct 2002
Posts: 14,579
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";
?>

Last edited by Machete_; 08-09-2005 at 01:03 PM..
Machete_ is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:03 PM   #5
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:04 PM   #6
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
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 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:06 PM   #7
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by AcidMax
include('./path/to/the/file');
that did it ;)

thanks!
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-09-2005, 01:15 PM   #8
AcidMax
Confirmed User
 
Join Date: May 2002
Location: MI
Posts: 1,827
Quote:
Originally Posted by JaceXXX
that did it ;)

thanks!

Glad it helped.
__________________
Latest MMA news. http://www.mmawrapup.com
AcidMax is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.