Php call another php file with parameters

i need to call a php inside another php file and pass some arguments also. how can i do this?? i tried

include["//.../myfile.php?file=$name"];
  • 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???

Unicron

7,0651 gold badge25 silver badges19 bronze badges

asked Mar 22, 2011 at 10:08

4

You don't have to pass anything in to your included files, your variables from the calling document will be available by default;

File1.php

Chủ Đề