Jump to content

include warnings...


gaogier

Recommended Posts

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

<?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

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

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.