最近使用会话查看了页面

时间:2013-03-13 15:14:29

标签: php session hyperlink

所以我收集最近浏览过的页面的代码是

<?php
session_start();
$currentpageurl = $_GET['username'];
$_SESSION['pageurl'][] = $_SERVER['REQUEST_URI'];

if( count( $_SESSION['pageurl'] ) > 10 ){
array_shift( $_SESSION['pageurl'] );
}
foreach( $_SESSION['pageurl'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'localhost".$value."'".' <br />';
}
?>

,显示它的代码是

<?php
session_start();

foreach( $_SESSION['pageurl'] as $key=>$value) {
echo 'The value of $_SESSION['."'".$key."'".'] is '."'localhost".$value."'".' <br />';
}
?>

问题是我只需要将url显示为文本即可点击它: $ _SESSION [&#39; 0&#39;]的值是&#39; localhost / works.php&#39;

我将如何使其可链接

1 个答案:

答案 0 :(得分:0)

echo '<a href="'.$_SESSION['0'].'">Click here</a>';