Hi,
This is probably a very basic question to many of you, but I'm just starting in PHP.
I need for a variable to be used on a remote file that is included and a new variable from this included file to be used on the script.
I'll try to demonstrate:
On my file1.php I have
<?php
$c=4;
include 'http://www.example.com/file2.php';
$multiply=$sum*2;
echo $multiply;
?>
On my file2.php:
<?php
$a = 2;
$b= 6;
$sum=$a+$b+$c;
?>
It is always returning 0 as in multiplication of 2 against and empty $sum variable.
What am I doing wrong? What is the best way to do such a thing? I'm sure there is a way to do it, probably altering the scope of the variables, but again, I'm just starting and would really need your advice.
Thanks for any help.