Jump to content

Images are not shown in IE8


Marooon

Recommended Posts

Hello all ,

 

I am facing a problem when trying to to show image files generated from php code in IE8 . it is working fine on firefox and IE9 .

but in IE8 its showing the famous red X instead of the image ;

 

 

belw is the code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="RTL" xmlns:o="urn:schemas-microsoft-com:office:office"  xmlns:v="urn:schemas-microsoft-com:vml" lang="en-us" >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<head>
<title>header </title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>

<?php mb_internal_encoding('UTF-8');

/**
* @author IT Department
* @copyright 2011
*/
INCLUDE ("header.php");
INCLUDE ("connect.php");

if (isset($_GET['id']))

{
$ID=$_GET['id'];
$sql="select 
employees.USER_ID, 
employees.NAME_ARAB,
employees.NAME_ENG,
employees.TITLE_ARAB, 
employees.TITLE_ENG, 
department.DEP_NAME_ENG,
department.DEP_NAME_ARAB, 
location.LOC_DESC_ENG,
location.LOC_DESC_ARAB,
employees.MOBILE, 
employees.EMAIL,
employees.DEP,
employees.LOC

FROM employees,location,department
WHERE 
employees.DEP=department.DEP_ID AND
employees.LOC=location.LOC_ID
and employees.USER_ID=$ID
  ";
//echo $sql;
$result=mysql_query($sql,$link);
mysql_query("SET NAMES 'utf8'");
    ECHO '<html DIR="RTL">';
echo "<table width=100%  border='1' cellpadding='8' align='center' bgcolor='white'>";

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
//$row = mysql_fetch_assoc($result);


echo"<tr align='center'>";
echo"<td>";
ECHO " الرقم الوظيفي :";
echo"</td>";
echo"<td colspan='2'>";
ECHO "<strong>$row[0]</strong>";
echo"</td>";
    echo"<td>";
ECHO " :  User ID ";
echo"</td>";
    echo"<td rowspan='7'>";
    ECHO "<img src='IMAGE.php?id=".$row[0]."' width='225' height='300'/>"; //the image
   	echo"</td>";
    echo "</tr>";

 

the php image file is :

 

 

<?php
INCLUDE ("connect.php");
$ID = "'".$_GET['id']."'";
$sql="SELECT PHOTO FROM employees WHERE USER_ID=$ID";
$result=mysql_query($sql,$link);
$row = mysql_fetch_array($result);
header("Content-type: image/pjpeg");
print ( $row[0]);
?>

 

 

Thanks in advance for your help :)

Link to comment
Share on other sites

Thanks for your reply

 

this is the view source code i added some break lines around the img tag:

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="RTL" xmlns:o="urn:schemas-microsoft-com:office:office"  xmlns:v="urn:schemas-microsoft-com:vml" lang="en-us" >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>


<table   border='0'  bgcolor='white'  width=80% align='center' >
<tr >
<td align='left'><font size=8 color='red'></font></td>
<td width=10>
<a href='/staff'>

<img src='img/logo.jpg'  align='left' border=0  /> 
</a>
</td>

</tr>
</table>
    <table align='center'  bgcolor='white' width=80%><tr><td><html DIR="RTL"><table width=100%  border='1' cellpadding='8' align='center' bgcolor='white'><tr align='center'><td> الرقم الوظيفي :</td><td colspan='2'><strong>78</strong></td><td> :  User ID </td><td rowspan='7'>
<img src='IMAGE.php?id=78' width='225' height='300'/>

</td></tr><tr align='center'><td> الاسم :</td><td><strong>مروان عدوان</strong></td><td><strong>Marwan Adwan</strong></td><td >Name  </td></tr><tr align='center'><td> المنصب الوظيفي :</td><td><strong>مدير قسم التطوير والتنقيب عن البيانات بالوكالة </strong></td><td><strong> Acting MIS Manager</strong></td><td >Title  </td></tr><tr align='center'><td>الإدارة :</td><td><a href='view_staff.php?dep=13' ><strong>إدارة تقنية المعلومات </strong></a></td><td><a href='view_staff.php?dep=13' ><strong>Information Technology Department</strong></a></td><td >Department  </td></tr><tr align='center'><td>المقر :</td><td><a href='view_staff.php?loc=1'><strong>دمشق</strong></a></td><td><a href='view_staff.php?loc=1'><strong>Damascus</strong></a></td><td >Location  </td></tr><tr align='center'><td>رقم الهاتف :</td><td colspan='2'><strong>988657179</strong></td><td >Mobile  </td></tr><tr align='center'><td>البريد الإلكتروني :</td><td colspan='2'><a href='mailto:M.Adwan@albarakasyria.com'><strong>M.Adwan@albarakasyria.com</strong></a></td><td >E-mail  </td></tr></TABLE><html><head><title>موظفي بنك البركة-سورية </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head></html>
<br>

<table cellpadding='10' cellspacing='10' border='4' align='center' bgcolor='white'>
<form name='search' METHOD='POST' action='View_staff.php'>
<tr>
<td>يرجى إدخال الرقم الوظيفي أو اسم الموظف المراد البحث عنه </td>
<td><input NAME='search' type='text' id='search'/></td>
<td><input type='submit'  value='البحث'></td></form></tr>
<form name='search_dep' METHOD='POST' action='View_staff.php'
<tr>
<td>عرض كافة الموظفين الموجودين بحسب إدارة :</td>
<td><select  name='search_dep'><option VALUE=1> ادارة الالتزام</option><option VALUE=2> ادارة التدقيق</option><option VALUE=3> ادارة الشؤون الادارية والموارد البشرية</option><option VALUE=4> الإدارة المالية </option><option VALUE=5> إدارة  الشؤون القانونية</option><option VALUE=6> إدارة التسويق </option><option VALUE=7> إدارة الخزينة والاستثمار </option><option VALUE=8> إدارة الرقابة الشرعية </option><option VALUE=9> إدارة الرئيس التنفيذي </option><option VALUE=10> إدارة العمليات </option><option VALUE=11> إدارة الفروع </option><option VALUE=12> إدارة المخاطر </option><option VALUE=13> إدارة تقنية المعلومات </option><option VALUE=14> إدارة تمويل التجزئة </option><option VALUE=15> إدارة تمويل الشركات</option><option VALUE=16> مراسلين وسائقين</option><option VALUE=17> مستخدمين</option><option VALUE=18> موظفي استقبال </option><option VALUE=19> الفرع الرئيسي</option><option VALUE=20> مكتب الشهبندر</option><option VALUE=21> فرع المزة</option><option VALUE=22> فرع حلب </option><option VALUE=23> فرع حمص </option><option VALUE=24> فرع حماه </option><option VALUE=25> فرع ابو رمانة </option></select></td><td><input type='submit'  value='البحث'></td></tr>
</form> <form name='search_loc' METHOD='POST' action='View_staff.php'
<tr>
<td>عرض كافة الموظفين الموجودين بحسب منطقة </td>
<td><select  name='search_loc'><option VALUE=1> دمشق</option><option VALUE=2> حلب</option><option VALUE=3> حمص</option><option VALUE=4> حماة</option></select></td><td><input type='submit'  value='البحث'></td></tr></table>
</form>
</td></tr>
</table>
<hr> <P ALIGN=Right><strong><strong></p>
</body>


</html>

Link to comment
Share on other sites

  • 2 weeks later...

i was looking at wrong place , it is not a php error !

It is IE8 BUG!

 

the images i was using were made in CYMK mode , not in RGB mode,while IE8 only support images created in RGB mode!

 

the solution i came up with is converting the image mode before uploading it!

 

 

Thank you all!

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.