main.php => include("". rand(1,3) .".php");
I need to include same result in main.php in a second page main_final.php.
How can i do for main_final
to include same result that main.php?
thank you very much !
main.php => include("". rand(1,3) .".php");
I need to include same result in main.php in a second page main_final.php.
How can i do for main_final
to include same result that main.php?
thank you very much !
You may use variables to do that. Store you result in the proper predefined variable: http://php.net/manual/en/reserved.variables.php
And read the value from both files. For example in main.php
:
$_SESSION["randomvalue"] = rand(1,3);
In the second file:
include($_SESSION["randomvalue"] .".php");