I have a php file
index.php and its url is index.php?var=item
I defined get variable in index.php
in index.php
<?php
require "included.php";
$var=$_GET['var'];
?>
I echoed this variable in my included.php
like below
in included.php
<?php
echo $var;
?>
When I launch index.php?var=item
, its shows an error that var is not defined in included.php
?
How to overcome this? I want to define some variables in index.php
from url and do some staff in included file.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…