|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
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? |
|
|
|
|
|
#2 |
|
Confirmed User
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.. |
|
|
|
|
|
#3 |
|
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 |
|
|
|
|
|
#4 |
|
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"; ?> |
|
|
|
|
|
#5 |
|
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 |
|
|
|
|
|
#6 | |
|
FBOP Class Of 2013
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
FBOP Class Of 2013
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
|
Quote:
thanks! |
|
|
|
|
|
|
#8 | |
|
Confirmed User
Join Date: May 2002
Location: MI
Posts: 1,827
|
Quote:
Glad it helped.
__________________
Latest MMA news. http://www.mmawrapup.com |
|
|
|
|