TinyPortal

Development => Support => Topic started by: mrandall131 on September 15, 2009, 02:57:42 PM

Title: require inside an article
Post by: mrandall131 on September 15, 2009, 02:57:42 PM
I am working on a front page article to pull info from my gaming script.  Problem is, I need to include my custom subs file.  I get an error in load every time I try and require the file.  What is the proper format for the require inside the article?

For example, my subs file is in ..../public_html/Sources/Battle/Subs-Battle.php

I have tried require_once('Subs-Battle.php') and require_once('..../public_html/Sources/Battle/Subs-Battle.php') to no avail.  Don't think the version is pertinent to this discussion but I am using SMF 1.1.8 and TP version 0.9.8.

Thanks!
Title: Re: require inside an article
Post by: JPDeni on September 15, 2009, 03:16:46 PM
I'm assuming that you're using a php article. (I know that should be obvious, but people have tried using php in html articles, so I have to say it. :) )

What is the error?
Title: Re: require inside an article
Post by: mrandall131 on September 15, 2009, 03:30:57 PM
Yep, PHP article.

Nevermind, in getting multiple test cases, I fixed the problem.  Looks like the default in my case is in the public_html folder and I was missing a folder in my require statement....

Title: Re: require inside an article
Post by: ZarPrime on September 15, 2009, 04:13:15 PM
OK then, marked solved. :up:

ZarPrime