is it possible for something like this to work:
include "somefile.php?var1=no&var2=yes&othervar=nothing";
If not, how can I do that? Thanks. Richard
hi! if you include a file your vars are known in the included file
$var1 = "no"; $var2 = "yes" $othervar = "nothing"; include ("somefile.php");
but if the somefile.php is expecting variables passed as a GET request, they won't be there, right?
Thanks. Richard
u can toggle like this in somefile.php
if (isset($_GET["var1"])){ $v1 = $_GET["var1"]; } else { $v1 = $var1; }
Originally posted by ukndoit but if the somefile.php is expecting variables passed as a GET request, they won't be there, right?
So put them there
$_GET['var1'] = "no"; $_GET['var2'] = "yes" $_GET['othervar'] = "nothing"; include ("somefile.php");
and ask yourself why you're using http GET in somefile.php in the first place if you're just including the file in another.