PHP在悬停丢失会话时打开iframe

时间:2016-09-08 08:22:29

标签: php session iframe

我正在尝试为linux服务器构建一个交互式监控工具,当我将鼠标悬停在一个弹出窗口但是会话丢失时会遇到问题,如果我点击链接而不是只是悬停会话正在工作时在新标签页中打开。

  

这是悬停代码的一部分

// Authenticate 
    //ob_start();
    session_start();
    require_once 'db.php';

    // Check if connected else redirect to login.
    if(!isset($_SESSION['user']) ) 
    {
        header("Location: login.php");
        exit;
    }

 $xcrud->column_pattern('filesystem', '<ul class="list-unstyled list-inline">
        <li class="dropdown"> 
            <a href="http://monitor.fandc.ro/getvgsize.php?server_name=' . $server_name . '&filesystem={filesystem}">{value}</a>
            <ul class="dropdown-menu">
                <iframe frameBorder="0" src="http://svnserver.fandc.ro/getvgsize.php?server_name=' . $server_name . '&filesystem={filesystem}">{value}</iframe>
            </ul>
        </li>
    </ul>');
  

这是我在iframe中添加的页面

// Authenticate 
    //ob_start();
    session_start();
    require_once 'db.php';

    // Check if connected else redirect to login.
    if(!isset($_SESSION['user']) ) 
    {
        header("Location: login.php");
        exit;
    }

    // getting service name in order to action on the selected service
$server_name = $_GET['server_name'];
$filesystem = $_GET['filesystem'];
echo "Filesystem: ";
echo $filesystem; 

// show vg size of each filesystem. 
$query3 = "select vg_$server_name.vgsize from df_$server_name, vg_$server_name where '%$filesystem%' LIKE CONCAT('%', vg_$server_name.vgname, '%')"; 
$xcrud7->query($query3);
$vg_size = $xcrud7->row(); 
$vgt = $vg_size['vgsize'];
if($vgt==null)
{
    $vgt = "No LVM";
}
echo "<br>FreeVG: ";
  

截图

This is how it looks when hover

If click on link session works ok.

0 个答案:

没有答案