RoninStretch Posted May 10, 2007 Share Posted May 10, 2007 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 More sharing options...
neel_basu Posted May 10, 2007 Share Posted May 10, 2007 Try include($itemFile); instead of include '$itemFile'; Link to comment https://forums.phpfreaks.com/topic/50754-how-to-include-using-variables/#findComment-249537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.