Moron Posted May 6, 2009 Share Posted May 6, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/ Share on other sites More sharing options...
Zhadus Posted May 6, 2009 Share Posted May 6, 2009 Show the code and what version of PHP are you running? Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827603 Share on other sites More sharing options...
peter_anderson Posted May 6, 2009 Share Posted May 6, 2009 Could you PM me / post your link, so I can see? Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827606 Share on other sites More sharing options...
Moron Posted May 6, 2009 Author Share Posted May 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827638 Share on other sites More sharing options...
PFMaBiSmAd Posted May 6, 2009 Share Posted May 6, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827642 Share on other sites More sharing options...
Moron Posted May 6, 2009 Author Share Posted May 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827647 Share on other sites More sharing options...
premiso Posted May 6, 2009 Share Posted May 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827648 Share on other sites More sharing options...
Moron Posted May 6, 2009 Author Share Posted May 6, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/157098-solved-ie8-displays-php-code/#findComment-827666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.