How would I pass a global var in two external scripts?
<div>
<!-- INCLUDEPHP 1.php -->
</div>
<div>
<!-- INCLUDEPHP 2.php -->
</div>
I have tried creating global variables on 1.php and `2.phpp but it didn’t work.
1.php:
<?php
global $someVar;
$sql = ...;
$someVar= $db -> sql_query($sql);
?>
2.php:
<?php
global $someVar;
echo "$someVar";
?>
Am I doing something wrong?
I would try including the scripts via PHP: