473,653 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browser Issue

I have written the following code as a test, (yes I know it is a
resource hog). Basically it pulls all images out of a MySQL table.

<?php
$conn = mysql_connect(h ost, user, pass);
mysql_select_db (testuser, $conn);

$query = "SELECT * FROM gallery";
$result = mysql_query($qu ery, $conn);

echo "<table width=\"50%\" align=\"center\ ">";
while($row = mysql_fetch_arr ay($result))
{
echo "<tr>";
echo "<td>$row[NAME] <br> $row[DESC] </td>";
echo "<td><IMG SRC=\"data:imag e/jpeg;base64," .
base64_encode($ row[IMG]) . "\"></td>";
}
echo "</table>";
mysql_close($co nn);
?>

Now I don't know where my problem is, but, when viewed with firefox, the
images load correctly, however when viewed with Internet explorer, the
images do not load.

You can see a example of the script in action at
http://codegurus.org/~mwalker/test.php

Does anyone know why the images will not show up in IE correctly?
Apr 13 '06 #1
19 1642
Materialised in news:4a******** ****@individual .net wrote:

[...]
echo "<td><IMG SRC=\"data:imag e/jpeg;base64," .
base64_encode($ row[IMG]) . "\"></td>"; [...]
Now I don't know where my problem is, but, when viewed with firefox, the
images load correctly, however when viewed with Internet explorer, the
images do not load.

You can see a example of the script in action at
http://codegurus.org/~mwalker/test.php

Does anyone know why the images will not show up in IE correctly?


AFAIK IE doesn't recognize <img> tags with inline source. No wonder you only
see it working in Firefox (and probabily Opera, too).

--
ColdShine

"Experience is a hard teacher: she gives the test first, the lesson
afterwards." - Vernon Sanders law
Apr 13 '06 #2
ColdShine wrote:
Materialised in news:4a******** ****@individual .net wrote:

[...]
echo "<td><IMG SRC=\"data:imag e/jpeg;base64," .
base64_encode($ row[IMG]) . "\"></td>";

[...]
Now I don't know where my problem is, but, when viewed with firefox, the
images load correctly, however when viewed with Internet explorer, the
images do not load.

You can see a example of the script in action at
http://codegurus.org/~mwalker/test.php

Does anyone know why the images will not show up in IE correctly?


AFAIK IE doesn't recognize <img> tags with inline source. No wonder you only
see it working in Firefox (and probabily Opera, too).

Thanks for your reply.
Do you know of any work arounds?
Apr 13 '06 #3
Save the image to a file. Not sure why the images are not in a file
anyway. Never could understand putting the images in a db.

Apr 13 '06 #4
fletch wrote:
Save the image to a file. Not sure why the images are not in a file
anyway. Never could understand putting the images in a db.

As I previously said, I have my reasons for storing the image to a database.
The main one is for secondary back up purposes.
Apr 13 '06 #5
> As I previously said, I have my reasons for storing the image to a database.

Not in this thread.

You _must_ have files that need backing up as well? Do you know of
rsync?

It is much more efficient to let the webserver deliver images directly,
and as I see it, there is no _good_ reason not to go that route.

Apr 13 '06 #6
fletch wrote:
As I previously said, I have my reasons for storing the image to a database.


Not in this thread.

You _must_ have files that need backing up as well? Do you know of
rsync?

It is much more efficient to let the webserver deliver images directly,
and as I see it, there is no _good_ reason not to go that route.

The client specifies the backup medium, mine is not to question why. lol
Apr 13 '06 #7
Ah one of _those_ clients. I have a few of them. Urgh. Like the one who
wanted a web based test which was to be delivered on CDRom and run on
only one laptop. My Javascript skills improved a lot though.

Apr 13 '06 #8
Materialised wrote:
ColdShine wrote:
Materialised in news:4a******** ****@individual .net wrote:

[...]
echo "<td><IMG SRC=\"data:imag e/jpeg;base64," .
base64_encode($ row[IMG]) . "\"></td>";


[...]
Now I don't know where my problem is, but, when viewed with firefox, the
images load correctly, however when viewed with Internet explorer, the
images do not load.

You can see a example of the script in action at
http://codegurus.org/~mwalker/test.php

Does anyone know why the images will not show up in IE correctly?

AFAIK IE doesn't recognize <img> tags with inline source. No wonder
you only see it working in Firefox (and probabily Opera, too).

Thanks for your reply.
Do you know of any work arounds?


What you need to do is create a PHP file to fetch the image, i.e. similar to:

getpic.php:
<?
if ($_GET['pid']) {
(connect to database and fetch row into $data)
header('Content : image/jpeg');
echo $data;
}

Then call it with

<img src="getpic.php ?id=1">


--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 13 '06 #9
fletch wrote:
As I previously said, I have my reasons for storing the image to a database.

Not in this thread.

You _must_ have files that need backing up as well? Do you know of
rsync?

It is much more efficient to let the webserver deliver images directly,
and as I see it, there is no _good_ reason not to go that route.


Sure - there are very good reasons for keeping images in the database. I also
do it when appropriate.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 13 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
3202
by: Tony Marston | last post by:
If the use of the browser's BACK button is interfering with the operation of your web application then take a look at this article entitle "Back Button Blues" http://www.tonymarston.co.uk/php-mysql/backbuttonblues.html -- Tony Marston http://www.tonymarston.net
115
7180
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." Yet if I use 'x-small' instead of 9pt, I get bigger type on IE6 and smaller type on Mozilla. My choices seem to be:
11
5065
by: David Lozzi | last post by:
Hello All, I am having an issue with thus far one computer on my client's web site. If the user loads the shopping cart and then closes all browser windows, then opens them back up, goes back to the site, the shopping cart information is there! The shopping cart info is only loaded into a session variable! There are no cookies on the site to store this information. Am I mistaken in believing when a browser window is closed that the session...
1
1557
by: Nathan DeBardeleben | last post by:
This may seem wierd, and I know someone asked this question before but was told they were doing it the hard way. Unlike them, I do not have shell access to the machine where this javascript runs. I need to run the 'submit' method on a Javascript on a page - but I need to do it without a browser. I can handle all the socket code, that's not the issue, the issue is what command I need to send. I should be able to hit the page and issue...
3
6213
by: Rob | last post by:
I have an ASP.Net web app that generates a Crystal Report in PDF format. Since there is sensitive data within the reports, the pdfs need to be streamed to the browser then deleted immediately. The report gets kick off by a Java application redirecting the URL to the ASP.Net app on the IIS Server with all report selection criteria appended to the querystring. The Crystal Report is rendered in a new window. In the Page_Load() event, I...
3
2240
by: Ben | last post by:
Hi, I'm sending out a session cookie. That is a cookie that has no expiration date. When I surf through the site, no problems, but if I close the browser and open it back up, the cookie is still there if other browser windows were open. Even if those windows didn't go to the site with the cookie or spawn from the browser that is visiting the site. This is causing a problem. People want to be able to close the browser to logout. How...
15
2819
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
14
2342
by: askMe | last post by:
I developed a web page that plays an mpg using the simple embed tag. When the page loads, the video starts, but then stops after a few seconds. I use the embed tag because I want the user's default player to kick in. What might be causing the video to start then stop? Thanks. http://www.askblax.com
5
2995
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each page to prevent user to navigate back but its not very effective. The server side scripting is done using ASP. you may ask that why at first place I want to disable the browser back
4
1615
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got an ASP.NET 1.1 application and I need to add to it new Browser Capabilities information for 3 new cellular phones. I used to use http://www.asp.net/mobile/profile/MyDevices.aspx to detect the Browser Capabilities for my devices, but now I can't get to that page. When I try to get there I get a login page. When I try to login it shows the same login page WITHOUT any error. I've got an account in www.asp.net (when...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.