1
stratoz4
BLOCKS.. need help
  • 2003/10/17 10:09

  • stratoz4

  • Just popping in

  • Posts: 53

  • Since: 2003/7/10


hi..

when i try to include a file using PHP in a block i get this error message.

--------------------------
Warning: Failed opening 'http://www.sharetrader.com.au/modules/mytrades/go.php' for inclusion (include_path='.;c:\php4\pear') in d:\home\sharetrader\class\xoopsblock.php(146) : eval()'d code on line 1
--------------------------

if i load the file i am trying to include on its own it works fine, but when i try to include in a block error happens..

i havent changed anything.. so i dont know why this is happening?

any help apreciated.

2
ackbarr
Re: BLOCKS.. need help

What version of php are you running? According to the php documentation:
Quote:
On Windows versions prior to PHP 4.3.0, the following functions do not support remote file accesing: include(), include_once(), require(), require_once() and the imagecreatefromXXX functions in the Reference XL, Image functions extension.


If you are running a version greater than 4.3.0 check the value of the "allow_url_fopen" setting in your php.ini

Also, the error message doesn't make this clear, but if the included page is on the local machine, try giving the local path to the file. Instead of this:
include(XOOPS_URL.'/modules/mytrades/go.php');

try this:
include(XOOPS_ROOT_PATH.'/modules/mytrades/go.php');

3
stratoz4
Re: BLOCKS.. need help
  • 2003/10/18 6:31

  • stratoz4

  • Just popping in

  • Posts: 53

  • Since: 2003/7/10


nope didnt work.. i dont understand, what i was using worked fine all this time, then all of a sudden it stopped working out of nothing?

4
ackbarr
Re: BLOCKS.. need help

well I just tried accessing that script:http://www.sharetrader.com.au/modules/mytrades/go.php and I got this error message:

Fatal error: Call to a member function on a non-object in d:\home\sharetrader\modules\mytrades\go.php on line 50
Room: Users

Perhaps this error is preventing the inclusion to occur?

5
stratoz4
Re: BLOCKS.. need help
  • 2003/10/19 3:23

  • stratoz4

  • Just popping in

  • Posts: 53

  • Since: 2003/7/10


That Error is occuring because its trying to access the database and i havent included the mainfile.php..

I cant include the mainfile.php.. if i do the file works when executed on it's own, but when included in a block it seems to cause errors..

maybe because mainfile.php is already loaded by the main page?

if i dont load mainfile.php, and include the file in a block, i get the same error as from the start.. call to non-member object.

any way around this?

6
ackbarr
Re: BLOCKS.. need help

sure, more recent versions of PHP have two functions include_once and require_once, which ensure that the included script has not been included before.

7
CiberEspia
Re: BLOCKS.. need help

interesting, I to take note!!!!

Login

Who's Online

137 user(s) are online (70 user(s) are browsing Support Forums)


Members: 0


Guests: 137


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits