PHP session start causes runtime error in IE 7

Posted on 2010-11-26
Medium Priority
Last Modified: 2012-05-10
I have a page that starts with

All works fine in Chrome and Mozilla but in IE7 I get a 'runtime error occurred on line 2. Object not supported. I'm developing it on Xampp locally if that's relevant.

Any ideas please? (I can post more code if it's not a common issue).

Thank you
Question by:swordfishsoup
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Expert Comment

ID: 34216565
A PHP runtime error or config issue shouldn't be browser dependent... Can you post more code, what else is going out to the browser, if anything? Try echoing something after session_start() and see if it's outputted properly in Chrome or FF.

Author Comment

ID: 34216643
Hi. Thanks for looking. I'm attaching the code down to the end of the Head. Yeah it is fine on all excpet IE7.
Thanks again.
<?php require_once('../Connections/burnerphp.php'); ?>
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  return $theValue;

mysql_select_db($database_burnerphp, $burnerphp);
$query_RsReferer = "SELECT * FROM tblreferers";
$RsReferer = mysql_query($query_RsReferer, $burnerphp) or die(mysql_error());
$row_RsReferer = mysql_fetch_assoc($RsReferer);
$totalRows_RsReferer = mysql_num_rows($RsReferer);

$media_RsMaster = "1";
if (isset($_SESSION['frmmedia'])) {
  $media_RsMaster = $_SESSION['frmmedia'];
$dupe_RsMaster = "3";
if (isset($_SESSION['frmdupe'])) {
  $dupe_RsMaster = $_SESSION['frmdupe'];
$print_RsMaster = "6";
if (isset($_SESSION['frmprint'])) {
  $print_RsMaster = $_SESSION['frmprint'];
$pack_RsMaster = "12";
if (isset($_SESSION['frmpack'])) {
  $pack_RsMaster = $_SESSION['frmpack'];
$paper_RsMaster = "17";
if (isset($_SESSION['frmpaper'])) {
  $paper_RsMaster = $_SESSION['frmpaper'];
$paperextra_RsMaster = "22";
if (isset($_SESSION['frmpaperextra'])) {
  $paperextra_RsMaster = $_SESSION['frmpaperextra'];
mysql_select_db($database_burnerphp, $burnerphp);
$query_RsMaster = sprintf("SELECT tblsiteproducts.ProductID, tblsiteproducts.ProductName, tblsiteproducts.class, tblsiteproducts.Price, tblsiteproducts.ProdImg FROM tblsiteproducts WHERE tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s", GetSQLValueString($media_RsMaster, "int"),GetSQLValueString($dupe_RsMaster, "int"),GetSQLValueString($print_RsMaster, "int"),GetSQLValueString($pack_RsMaster, "int"),GetSQLValueString($paper_RsMaster, "int"),GetSQLValueString($paperextra_RsMaster, "int"));
$RsMaster = mysql_query($query_RsMaster, $burnerphp) or die(mysql_error());
$row_RsMaster = mysql_fetch_assoc($RsMaster);
$totalRows_RsMaster = mysql_num_rows($RsMaster);

mysql_select_db($database_burnerphp, $burnerphp);
$query_RsDelivery = "SELECT ProductID, ProductName, Price FROM tblSiteProducts WHERE ProductID = 33 OR ProductID = 34";
$RsDelivery = mysql_query($query_RsDelivery, $burnerphp) or die(mysql_error());
$row_RsDelivery = mysql_fetch_assoc($RsDelivery);
$totalRows_RsDelivery = mysql_num_rows($RsDelivery);

mysql_select_db($database_burnerphp, $burnerphp);
$query_RsBase = "SELECT * FROM tblbase";
$RsBase = mysql_query($query_RsBase, $burnerphp) or die(mysql_error());
$row_RsBase = mysql_fetch_assoc($RsBase);
$totalRows_RsBase = mysql_num_rows($RsBase);

$media_RsPrice = "1";
if (isset($_SESSION['frmmedia'])) {
  $media_RsPrice = $_SESSION['frmmedia'];
$dupe_RsPrice = "4";
if (isset($_SESSION['frmdupe'])) {
  $dupe_RsPrice = $_SESSION['frmdupe'];
$print_RsPrice = "5";
if (isset($_SESSION['frmprint'])) {
  $print_RsPrice = $_SESSION['frmprint'];
$pack_RsPrice = "8";
if (isset($_SESSION['frmpack'])) {
  $pack_RsPrice = $_SESSION['frmpack'];
$paper_RsPrice = "17";
if (isset($_SESSION['frmpaper'])) {
  $paper_RsPrice = $_SESSION['frmpaper'];
$paperextra_RsPrice = "22";
if (isset($_SESSION['frmpaperextra'])) {
  $paperextra_RsPrice = $_SESSION['frmpaperextra'];
mysql_select_db($database_burnerphp, $burnerphp);
$query_RsPrice = sprintf("SELECT sum( tblsiteproducts.Price ) as total_price  FROM tblsiteproducts WHERE tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s OR tblsiteproducts.ProductID = %s", GetSQLValueString($media_RsPrice, "int"),GetSQLValueString($dupe_RsPrice, "int"),GetSQLValueString($print_RsPrice, "int"),GetSQLValueString($pack_RsPrice, "int"),GetSQLValueString($paper_RsPrice, "int"),GetSQLValueString($paperextra_RsPrice, "int"));
$RsPrice = mysql_query($query_RsPrice, $burnerphp) or die(mysql_error());
$row_RsPrice = mysql_fetch_assoc($RsPrice);
$totalRows_RsPrice = mysql_num_rows($RsPrice);
<?php $_SESSION['unitcost']=$row_RsPrice['total_price']; ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Complexity HTML Theme</title>
<!--db start-->
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/basic.css" rel="stylesheet" type="text/css" />
<link href="../css/contact.css" rel="stylesheet" type="text/css" />

<!--IE 6 "fixes"-->
<!--[if lt IE 7]>
<link type='text/css' href='css/basic_ie.css' rel='stylesheet' media='screen' />
<script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js"></script>
<script type='text/javascript' src='../JScript/contact.js'></script>
<!-- db end -->
<!-- SEO -->
<meta name="keywords" content="keyword 1, keyword 2, keyword 3, keyword 4" />
<meta name="description" content="Put a description of your site here for the Search Engines." />

<!-- JS -->
<!--<script type="text/javascript" src="../../layout/js/jquery.js"></script>-->
<script type="text/javascript" src="../../layout/js/cycle.js"></script>
<script type="text/javascript" src="../../layout/js/hoverIntent.js"></script>
<script type="text/javascript" src="../../layout/js/superfish.js"></script>
<script type="text/javascript" src="../../layout/plugins/prettyphoto/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="../../layout/js/validate.js"></script>
<script type="text/javascript" src="../../layout/js/custom.js"></script>

<script language="javascript" type="text/javascript" src="../JScript/pricing.js"></script>
<script language="javascript" type="text/javascript" src="../JScript/check.js"></script>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="../../layout/css/reset.css" />
<link rel="stylesheet" type="text/css" href="../../layout/plugins/prettyphoto/css/prettyPhoto.css" />
<link rel="stylesheet" type="text/css" href="../../style.css" />

<!-- Specific Style -->
<link rel="stylesheet" type="text/css" href="../../layout/css/style1.css" />

<!--[if IE 6]>
<script type='text/javascript' src='layout/js/dd_belated_png.js'></script>

<!-- Slideshow Nav -->
<script type="text/javascript">
function paginate(idx, slide){	
	return '<a href="" title="" class="ie6"><img src="layout/images/transparent.png" alt="" class="ie6" /></a>';


Open in new window


Author Comment

ID: 34217340
I disabled script debugging in Internet Explorer which has solved the issue for me. But I'm still unsure why the error came up in the first place. And does anyone know if debugging will be 'off' in the general public versions of IE7?
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users


Accepted Solution

i-CONICA earned 2000 total points
ID: 34217529
This is not a problem with your PHP code (which I can't fully test because I don't have that included file). It's a problem with your Javascript. As said, a server side error can't be browser dependent. So it's got to be client side, aka the javascript.

IE can be a bugger with subtle JS errors, run all JS through JSLint to see if it gives you any problems to fix... I'm not a JS expert so can't really offer much advice on that, but it's definatley not a problem with your PHP.

Ps, why do you end PHP and restart it on lines 3/4 and 4/5? There's no need. All you're doing there is starting to send content to the browser, that new line has to be sent, along with headers, meaning you can't modify them beyond that point... Keep it all in PHP until you need to send out content. :)

Author Comment

ID: 34217689
Thanks for that advice. I'll check the Jquery and report back.
as for
why do you end PHP and restart it on lines 3/4 and 4/5?
Because I tend to have to work it all out as I go along and didn't do any basic training - Costs me hours, good job I'm stubborn. Thanks, I'll correct that though.

Author Comment

ID: 34217749
You were dead right. It was one of the Js files. I've tidied up the PHP too.
Thanks again for your help.

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question