Send Variables to different php file


I am trying to send a variable to a different php file. For example: (old.php)

$s = '4'
$s = $s + $s

Now I want to be able to use the variable in a new php file. For example: (new.php) echo $s;

How would I do this?


I’m not sure if this is very clear


depending on what method you use for getting from old.php to new.php you could send it in a form and submit it (using a hidden type input) or you could send it using the GET method in the URI such as