Jump to content

include warnings...


gaogier

Recommended Posts

<?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. Edited by kicken
Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.