Re: Error - Cannot pass paramter --> Failed to open stream



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
==================
.



Relevant Pages

  • Re: WME 9.1 x64 output file create/naming errors
    ... I'm specifying the input filename as a full file/path name, ... that the first file created in each output folder by WME is ... I can't rule out this is a potential bug in the 64 bit encoder, ...
    (microsoft.public.windowsmedia.encoder)
  • Re: need help with exporting figures into jpgs
    ... Problem reading Figure handle in -f switch: ... You can print a noncurrent figure by specifying the figure's handle. ... This example uses the function form of print to enable a file name to ... print('-f3', '-dpsc', filename); ...
    (comp.soft-sys.matlab)
  • Re: Creating file with long filename
    ... > I'm trying to create a file with long filename, ... > mov ax,716Ch ... Pointer to a null-terminated string specifying the name of the file to be opened or created. ... Number that is used in the numeric tail for the alias. ...
    (comp.lang.asm.x86)
  • Re: Doubts about appending data to a file
    ... filename has been already created by another call to displaymsg. ... I was taught never to open a file without specifying the ...
    (comp.lang.fortran)
  • Re: is something wrong in it?
    ... Specifying a path to the executable (e.g. by prefixing ./ to the filename when it exists in the current directory) tells the shell exactly where to find it, so it doesn't bother looking in $PATH. ... it stops working when you open Windows. ...
    (comp.os.linux.misc)