Re: Error - Cannot pass paramter --> Failed to open stream
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Sat, 30 Sep 2006 11:16:58 -0400
Colin McKinnon wrote:
One wrote:
Andy Hassall wrote:
You can't do that. "?" is for URLs, but you're specifying a filename.
With the
"?", you're specifying a filename that doesn't exist.
ah ha. I know - In the past I have passed it as a parameter like this :
include "http://www.www.com/file.php?menu=david"
This has worked.
Yes, but its very dangerous unless you really, really know what you're
doing.
If you want to pass variables into the include file, just set them
before you
do the include, they'll be visible in the include file. (Or pass them as
parameters to whatever functions you define in the include file).
You mean like this ?
<?php
echo "<form><input type="hidden" name=menuid" value="david"></form>";
include file.php
?>
No - like
$GLOBALS['menuid']='david';
include ('file.php');
C.
You don't even need to use globals.
Just
$menuid = 'david';
and in the include file you can use
if ($menuid == 'david') ...
An include acts just like if you cut/paste the code from the included file in place of the 'include' statement.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- References:
- Error - Cannot pass paramter --> Failed to open stream
- From: One
- Re: Error - Cannot pass paramter --> Failed to open stream
- From: Andy Hassall
- Re: Error - Cannot pass paramter --> Failed to open stream
- From: One
- Re: Error - Cannot pass paramter --> Failed to open stream
- From: Colin McKinnon
- Error - Cannot pass paramter --> Failed to open stream
- Prev by Date: Help with loop
- Next by Date: Re: PHP with no file extension
- Previous by thread: Re: Error - Cannot pass paramter --> Failed to open stream
- Next by thread: Re: Error - Cannot pass paramter --> Failed to open stream
- Index(es):
Relevant Pages
|