Jump to content

[SOLVED] IE8 displays php code


Moron

Recommended Posts

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.

 

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.

 

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.