gaogier Posted May 3, 2013 Share Posted May 3, 2013 First lets deal with the news warning found here, http://runehints.com/ Here is my php code <div id="contenttitle">RuneHints News<?php include("includes/newsfeed.php"); ?></div> <?php include("community/ssi.php?a=newsnew&show=9&f=2,99"); ?> Link to comment https://forums.phpfreaks.com/topic/277582-include-warnings/ Share on other sites More sharing options...
PaulRyan Posted May 3, 2013 Share Posted May 3, 2013 The errors on your website tell you exactly what is wrong, that is pretty much what they are there for.As the error says "No such file" it means that the file you are including does not exist. Link to comment https://forums.phpfreaks.com/topic/277582-include-warnings/#findComment-1427942 Share on other sites More sharing options...
gaogier Posted May 3, 2013 Author Share Posted May 3, 2013 the file is there though, http://runehints.com/community/ssi.php?a=newsnew&show=9&f=2,99 If I make the line <?php include("http://runehints.com/community/ssi.php?a=newsnew&show=9&f=2,99"); ?> I get no errors no news Link to comment https://forums.phpfreaks.com/topic/277582-include-warnings/#findComment-1427943 Share on other sites More sharing options...
kicken Posted May 3, 2013 Share Posted May 3, 2013 <?php include("community/ssi.php?a=newsnew&show=9&f=2,99"); ?>You can't pass parameters like that using include. The value you give to include is the name of a file, not a URL (in this case) so URL style parameters are not allowed. An included file has access to all the variables defined in the current scope so to pass those variables you could just do: $_GET['a'] = 'newsnew'; $_GET['show'] = 9; $_GET['f']= '2,99'; include('community/ssi.php'); The above assumes ssi.php is expecting $_GET['a'], etc. If it expects just $a, etc then set those variables instead. Link to comment https://forums.phpfreaks.com/topic/277582-include-warnings/#findComment-1427944 Share on other sites More sharing options...
gaogier Posted May 3, 2013 Author Share Posted May 3, 2013 You can't pass parameters like that using include. The value you give to include is the name of a file, not a URL (in this case) so URL style parameters are not allowed. An included file has access to all the variables defined in the current scope so to pass those variables you could just do: $_GET['a'] = 'newsnew'; $_GET['show'] = 9; $_GET['f']= '2,99'; include('community/ssi.php'); The above assumes ssi.php is expecting $_GET['a'], etc. If it expects just $a, etc then set those variables instead. That gives this error Warning: require_once(./initdata.php) [function.require-once]: failed to open stream: No such file or directory in/disk3/gaogier/public_html/community/ssi.php on line 79 Fatal error: require_once() [function.require]: Failed opening required './initdata.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /disk3/gaogier/public_html/community/ssi.php on line 79 Link to comment https://forums.phpfreaks.com/topic/277582-include-warnings/#findComment-1427945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.