I'm creating a "static" page from the content menu and i need to post a class from a php file i made myself. The thing is that drupal freaks and gives this error:
Fatal error: Class 'stockdata' not found in /home/clinton/hdd1/drupal/includes/common.inc(1342) : eval()'d code on line 11

This is my simple 3 liner php code i need to insert into the page, and yes i do have the input settings to accept php.

require_once('http://www.coldowl.com/project/project/stock/tests/graham.php');
$stockdata = new stockdata();
$stockdata->coldowl_mysql_retrieve();

Feel free to look at my error on the website itself
link

Comments

r0g’s picture

Sorry I don't have a solution, just interested to see the responses.

r0g

chx’s picture

When you issue that require_once , then you will load the output instead of the source of that script.
--
The news is Now Public | Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

afbase’s picture

Thanks chx, I just kinda copy/pasted the class that i need, and so far it seems to clear up some bugs.

Cheers ;-)

afbase’s picture

So as long as I am not the only one that's curious :-)

I looked on this page of drupal.org, http://drupal.org/node/87080 ; it seems that the require_once() has some issues in class methods/functions. So does this mean that require_once() can't be used period???? if so how do i circumvent this issue?

afbase’s picture

Why does drupal think that my other mysql database is the drupal database?

I'm using another mysql database, "intelligent", to retrieve data from it
I really...REALLY don't want to add my intelligent db tables into the drupal db.

once again look at this problem.
http://www.coldowl.com/?q=node/841

afbase’s picture

http://drupal.org/node/18429

Gives a great description on how to connect to multiple db's.
:-)

torez’s picture

So is there a solution to this? I want to include or require a file in the header of a single view and not put the code in a text field, which will hopefully add some sanity to the chaos that is Drupal. Prove me wrong people, prove me wrong.

carn1x’s picture

subscribe / bump

edit: saw it's drupal 5.x , still if the solution happens to be the same for drupal 6.x then I don't mind necroing >:D