Jump to content

How to include using variables?


RoninStretch

Recommended Posts

Thanks for looking..

 

I have a database that stores a few bits of info and then an URL for a file to be executed.

 

Here's an example of a row from it..

 

name = BoxOfTricks

Cost = 2000

Pic = images/boxoftricks.gif

fileurl = items/boxoftricks.php

 

 

but when i pull the fileurl into a variable I can't seem to use that to make it include the file..

 

$itemFile = mysql_result($result,0,"fileurl");

include '$itemFile';

 

the itemFile variable prints out fine.. but i get these errors:

 

Warning: main($itemFile): failed to open stream: No such file or directory in stygian/itemLauncher.php on line 31

 

Warning: main(): Failed opening '$itemFile' for inclusion (include_path='.:/usr/local/lib/php/') in stygian/itemLauncher.php on line 31

 

Is what I'm trying even possible?

Link to comment
https://forums.phpfreaks.com/topic/50754-how-to-include-using-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.