i need to call a php inside another php file and pass some arguments also. how can i do this?? i tried
include("http://.../myfile.php?file=$name");
if i write like
$cmd = "/.../myfile.php?file=".$name";
$out =exec($cmd. " 2>&1");
echo $out;
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;
File1.php
<?php
$variable = "Woot!";
include "File2.php"; //if in the same folder
File2.php
<?php
echo $variable;
the location in your code is incorrect:
$cmd = "/.../myfile.php?file=".$name;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With