<?php
$Frase = "minha frase";
?>
On my Y page I want to get the value of one of these variables, eg:
<h3>
<?php $Frase; ?>
How could I receive the result of these variables from other pages? would anyone have an example?
<?php
$Frase = "minha frase";
?>
On my Y page I want to get the value of one of these variables, eg:
<h3>
<?php $Frase; ?>
How could I receive the result of these variables from other pages? would anyone have an example?
Knowing that the file "other_file.php" has:
<?php
$frase = "abcdef";
?>
In another file (from the same directory) you can include the variable as follows:
<?php
include('outro_ficheiro.php');
echo $frase;
?>
By session.
<?php
session_start(); # Deve ser a primeira linha do arquivo
$frase = "Minha Frase";
$_SESSION['frase'] = $frase;
?>
<?php
session_start(); # Deve ser a primeira linha do arquivo
echo $_SESSION['frase'];
?>