| | |
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 |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white wordpress xml youtube






