Web Hosting Talk







View Full Version : Quick PHP question...


Studio64
03-09-2002, 02:27 AM
function IncludeMe($Name)
{
include($Name);
}


I know this doesn't work...

But, does anyone know a workaround to this?...
Does passing by reference fix this?

The Prohacker
03-09-2002, 02:57 AM
Just for the hell of it...
Try: include $Name;

Its almost 1am, so I can bearly think straight :D

Studio64
03-09-2002, 04:25 AM
Yeah it's late.... quite frankly i'm drunk now...

the include $name doesn't work... (At least not w/ my version)

Which is what lead to the attempted function call... which b/c the first doesn't work... why should the the curent function work...

i'm just trying to avoid a huge switch statment in a sub-function... tis all...

sjau
03-09-2002, 04:47 AM
try this:

include ("$name");

The Prohacker
03-09-2002, 09:44 AM
Originally posted by Studio64
Yeah it's late.... quite frankly i'm drunk now...

the include $name doesn't work... (At least not w/ my version)

Which is what lead to the attempted function call... which b/c the first doesn't work... why should the the curent function work...

i'm just trying to avoid a huge switch statment in a sub-function... tis all...


What version of PHP? And is $Name a relative path, or absolute....

kunal
03-09-2002, 11:01 AM
the code you have given would work... but the variables or the file properties would be exclusive only to that function.. you cant access them outside that function unless you declare the variables as global :)