i need to call a php inside another php file and pass some arguments also. how can i do this??
- but gives access denied. i read like v must not set allow_url_open to OFF.
if i write like
$cmd = "/.../myfile.php?file=".$name"; $out =exec($cmd. " 2>&1"); echo $out;
- gives error as /…/myfiles.php?file=hello: no such file or directory.
how can i solve this???
You don’t have to pass anything in to your included files, your variables from the calling document will be available by default;
<?php $variable = "Woot!"; include "File2.php"; //if in the same folder
<?php echo $variable;
the location in your code is incorrect:
$cmd = "/.../myfile.php?file=".$name;
you can include file over http only if the allow_url_fopen is set to TRUE, and the same parameter allow you to pass variables to the files…
You should not include files via HTTP connection – that’s almost always a serious security problem.
If you must do this, you have to set
ON but neither is a recommended procedure.