在 logged.php
中:
$TPL->NavBar('active',' ');
在 class.template.php
中:
public function NavBar($home,$about) {
$this->Content('navigator_bar');
}
在 navigator_bar.php
中:
<li class= <?php $home ?> ><a href="home">Home</a></li>
<li class= <?php $about ?> ><a href="about">About</a></li>
是否可以将 $home
和 $about
变量链接到一个新的 file.php
中?
最佳答案
使用$_GET、$_POST、$_REQUEST等请求方式将数据发送到您的 new_file.php
或
在 session 中设置变量以在你的 new_file.php 中获取它
session 中:
In Logged.php:
echo $_SESSION['home_val'] = $home;
echo $_SESSION['about'] = $about;
In new_file.php:
$_SESSION['home_val'];//gives $home
$_SESSION['about'];//gives $about
关于php - 事件 div 的可能代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14523063/