| | |
Weird issue: code breaking site in IE6
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Sep 2008
Posts: 16
Reputation:
Solved Threads: 0
It might be an issue with my laptop's IE6 although I haven't ascertained this.
Anyway, I'm having a really weird issue. When I open my website in IE6 and click on a link inside that page, the page doesn't load for some reason. I just get the background color and if I try and link on View Source nothing comes up. However if I refresh the page, the page is shown as expected.
I'm totally stumped as to why this happens although I've been able to narrow it down to the following script which is being run at the top of my pages:
EDIT: I've figured out session_start() is causing the issue. Commenting it out fixes the problem. Now I want to know why this happens and how on earth I can work around it.
Any ideas?
Anyway, I'm having a really weird issue. When I open my website in IE6 and click on a link inside that page, the page doesn't load for some reason. I just get the background color and if I try and link on View Source nothing comes up. However if I refresh the page, the page is shown as expected.
I'm totally stumped as to why this happens although I've been able to narrow it down to the following script which is being run at the top of my pages:
EDIT: I've figured out session_start() is causing the issue. Commenting it out fixes the problem. Now I want to know why this happens and how on earth I can work around it.
PHP Syntax (Toggle Plain Text)
<?php session_start(); $loginBar = false; //Check if logged in if (strcmp($_SESSION['loggedIn'], 'true') != 0) { if (!isset($openPage)) { header('location:loginpage.php'); } } else if (strcmp($_SESSION['loginType'], 'admin') == 0) { if (!isset($openPage)) { header('location: admin.php'); } } else { $username = $_SESSION['user']; $loginBar = " <div class=\"loginBar\"> Logged in as student: $username <a href=\"loginpage.php?action=logout\">Logout</a> </div> "; } ?>
Any ideas?
Last edited by NRaf; Oct 7th, 2008 at 7:08 am.
•
•
Join Date: Sep 2008
Posts: 16
Reputation:
Solved Threads: 0
I figured it out through a fix on the internet. It was the session_start() that was causing the issue but replacing it with the following code block seemed to have fixed the issue:
No idea why it works, so if anyone can explain it, I'd appreciate it.
PHP Syntax (Toggle Plain Text)
//Needed to work in IE6 ob_start(); session_start(); header("Cache-control: private"); ob_flush();
No idea why it works, so if anyone can explain it, I'd appreciate it.
![]() |
Other Threads in the PHP Forum
- Previous Thread: Saving Images..
- Next Thread: foreach help PLEASE
| Thread Tools | Search this Thread |
# 5.2.10 access alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code convert cron curl database date directory display dissertation dropdown dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory ip javascript joomla legislation limit link local login mail memberships menu methods mlm multiple multipletables mysql mysqlquery newsletters oop open passwords paypal pdf persist php provider query radio random redirect script search secure server sessions simple sockets source space spam sql system table tutorial upload url user variable video voteup web youtube






