serephent Posted February 12, 2007 Share Posted February 12, 2007 I have a page and it was running fine using an include file and without me changing anything, it's not now and I don't understand. <? include("files.$title.php"); ?> And the error is: Warning: include(filesphp) [function.include]: failed to open stream: No such file or directory in /home/.deva/quillsandink/i-sitedesign.org/view.php on line 16 Warning: include() [function.include]: Failed opening 'filesphp' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/.deva/quillsandink/i-sitedesign.org/view.php on line 16 Help? Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/ Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 $title isn't set. You could try <? include('files'.$title.'.php'); ?> But unless $title has a value, it won't work any better. Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182394 Share on other sites More sharing options...
serephent Posted February 12, 2007 Author Share Posted February 12, 2007 It's set in my nav. This is inside of a view file. So, when you click on " view.php?title=main" it opens "view.php" with "main.php" taking the place of the include file as the content of the page, but it keeps giving that error instead. Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182401 Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 $title = $_GET['title']; Register Globals = off Your host may have made a change. Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182405 Share on other sites More sharing options...
serephent Posted February 12, 2007 Author Share Posted February 12, 2007 I'm sorry, I am still learning PHP, can you be a tad more specific? I need to change what line to what? Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182408 Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 You need to add that in before you can use the $title variable. Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182410 Share on other sites More sharing options...
The Little Guy Posted February 12, 2007 Share Posted February 12, 2007 Does it need to look like this? <? include("files/$title.php"); ?> I removed the first period, but maybe your file naming system is files.xxx.php, I don't know how your doing it though. it's my only guess Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182412 Share on other sites More sharing options...
serephent Posted February 12, 2007 Author Share Posted February 12, 2007 I'm sorry, feel like a dolt over here, but add it where? On the view.php page? And add it how? Just at the top of the page? Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182413 Share on other sites More sharing options...
Jessica Posted February 12, 2007 Share Posted February 12, 2007 Before...you...use...the...variable Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182414 Share on other sites More sharing options...
serephent Posted February 12, 2007 Author Share Posted February 12, 2007 Working now. Thanks for the help and your patience with me. I greatly appreciate it. Link to comment https://forums.phpfreaks.com/topic/38100-solved-include-file-error/#findComment-182420 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.