I need to call php inside another php file and pass some arguments. How can i do this?? I tried
include("http://.../myfile.php?file=$name");
if i write how
$cmd = "/.../myfile.php?file=".$name"; $out =exec($cmd. " 2>&1"); echo $out;
how can i solve this problem?
You do not need to transfer anything to your included files, your variables from the calling document will be available by default;
File1.php
<?php $variable = "Woot!"; include_file "File2.php";
File2.php
<?php echo $variable;
you can include a file via http only if allow_url_fopen is set to TRUE, and the same parameter allows you to transfer variables to files ...
You should not include files over an HTTP connection, which is almost always a serious security issue.
If you must do this, you need to set allow_url_include and allow_url_fopen to ON , but none of them are recommended.
allow_url_include
allow_url_fopen
ON
incorrect location of your code:
$cmd = "/.../myfile.php?file=".$name";