Jump to content

[SOLVED] IE8 displays php code


Moron

Recommended Posts

Anyone else seen this? My program, which works 100% perfectly in IE7 and back, displays php code in IE8.

 

My pages begin with session commands at the top. If I put an <HTML> tag before that, it works in IE8 but then it throws errors all over the place in IE7 and back.

 

Ideas?

 

Link to comment
Share on other sites

This is running internally, so no outside access.

 

The top of one of the pages is....

 

<?php 
ini_set('session.bug_compat_42',0);
ini_set('session.bug_compat_warn',0);


session_start();
if(isset($_POST['password'])) {$_SESSION['password'] = $_POST['password'];}
if(isset($_POST['empcode'])) {$_SESSION['empcode'] = $_POST['empcode'];}

header('Content-Type: image/jpeg');



?>

<html>
<head>
<title>Employee Information</title>

 

Again, it works perfectly in IE 7 and back. Try this in IE 8 and you get the code displayed.

 

I'll go out on a limb in assuming that it's some new "security" feature in IE 8, since that's usually how Microsoft does things, but I could be wrong.

 

Link to comment
Share on other sites

Php is parsed by the web server. If you are seeing php code in the browser it means the php code is not being parsed by the web server.

 

What is the URL you are entering in your browser?

 

But here's the kicker: if I put an <HTML> tag before the above code, then it works in IE 8, but throws errors in IE 7.

 

We're running PHP 5. The URL isn't accessible from the outside as this is strictly an intranet application.

 

Link to comment
Share on other sites

header('Content-Type: image/jpeg');

 

That is why you see text. You are saying the content type is an image. Remove that line and it should work like expected.

 

As to why that would work in IE7 and not IE8 is beyond me, but yea.

Link to comment
Share on other sites

header('Content-Type: image/jpeg');

 

That is why you see text. You are saying the content type is an image. Remove that line and it should work like expected.

 

As to why that would work in IE7 and not IE8 is beyond me, but yea.

 

I removed it and .....it WORKS!

 

Thanks, everyone.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.