Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP session not working in IE
    text
    copied!<p>Heey people, in the following code my session is not working in IE. i dont know why cause to me there is nothing wrong.</p> <p>browser.php // here php looks for on what browser your opening the page on:</p> <pre><code>&lt;?php session_start(); if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') ) { if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape') ) { $browser = 'Netscape '; } else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') ) { $browser = 'Firefox'; } else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) { $browser = 'Chrome'; } else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari')) { $browser = 'Safari'; } } else if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) { if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') ) { $browser = 'Opera '; } else { $browser = 'Explorer'; } } else { $browser = 'Others browsers'; } $_SESSION['Ibrowser'] = $browser; ?&gt; </code></pre> <p>Print.php // this is a page where i want to print a pdf due to an iFrame</p> <pre><code>&lt;?php session_start(); include("Browser.php"); ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;wk demo&lt;/title&gt; &lt;link href="css/main.css" rel="stylesheet" type="text/css" /&gt; &lt;script language="javascript"&gt; function printTrigger(elementId) { var browser = '&lt;?php echo $_SESSION['Ibrowser']; ?&gt;'; var iFramePdf = elementId; /*alert("hello world");*/ if(browser == "") { alert("session is leeg"); } else { if(browser == 'Explorer') { //alert("IE"); window.frames[iFramePdf].focus(); window.frames[iFramePdf].print(); } else if(browser == 'Safari') { //alert("Safari"); window.frames[iFramePdf].focus(); window.frames[iFramePdf].print(); } else if(browser == 'Chrome') { //alert("Chrome"); var getMyFrame = document.getElementById(elementId); getMyFrame.focus(); getMyFrame.contentWindow.print(); } else if(browser == 'Firefox') { //alert("Firefox"); window.open('http://62291.ict-lab.nl/Stage/VDMdm/pdf.php'); } else { alert("Onbekende Browser"); } } } &lt;/script&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload