HighDots Forums  

IE not showing PHP-generated images, but Firefox does.

alt.html alt.html


Discuss IE not showing PHP-generated images, but Firefox does. in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
dorayme
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-21-2008 , 11:58 PM






In article <Xns9A68D85604297neredbojiasnano (AT) 85 (DOT) 214.90.236>,
Neredbojias <example (AT) example (DOT) com> wrote:

Quote:
Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it...
no... surely not... the lovely, sensitive, Jerry Stuckle? Is this
character doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to
waste your energy. He just pisses and has wooden spiels. Telling
him to quit this would be like trying to get Saddam to personally
make and serve breakfast to a Kurd or a Marsh Arab instead of
say, gassing them.

--
dorayme


Reply With Quote
  #12  
Old   
Michael Fesser
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 12:07 AM






..oO(Neredbojias)

Quote:
On 21 Mar 2008, Michael Fesser <netizen (AT) gmx (DOT) de> wrote:

.oO(Neredbojias)

Anyway, _I_ don't know where in that labyrinth of a php manual you'll
find this (-if anywhere), but I'm tired of wasting my own time. This
line from the code of one of my old pages:

if (!($_FILES['filup']['type'] == "image/jpeg" ||
$_FILES['filup']['type'] == "image/pjpeg")) {

...rather explains it.

Not really, it's broken code.

Bullshit.
The code snippet above relies on optional and easy to fake informations.
I could upload an executable or another script which would easily pass
the check. Dependent on the rest of the script it might be even possible
to call that uploaded script, which would be a nice security hole.

Quote:
You determine the real type of an uploaded
image with getimagesize().

No, you don't. There is no filename so how can you?
Of course there is a filename. There might be even two of them: the one
sent by the browser (optional) and the temporary name that PHP assigns
to the uploaded file. So you have the file, you have a name, the storage
location and getimagesize(). That's enough for a _correct_ and reliable
image type check.

Quote:
The Content-Type header sent by the browser
is more or less just decoration and should be seen as that. It can be
faked or not available at all, so you can't rely on it.

Perhaps a brief tutorial on php file uploads will enlighten you:

http://www.tizag.com/phpT/fileupload.php

And BTW: The thread was about _downloading_ images, not uploading.

So?
Yes.

Quote:
My original comment was "In certain php image manipulations, different
code is required for ie than is for other browsers.".
Still wrong and completely unnecessary. Maybe it's you who should read
something about PHP file uploads? Above is a link to a short tutorial...

Micha


Reply With Quote
  #13  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 07:31 AM



Neredbojias wrote:
Quote:
On 21 Mar 2008, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote:

Neredbojias wrote:
On 21 Mar 2008, Jerry Stuckle <jstucklex (AT) attglobal (DOT) net> wrote:

I've discovered that there is a big discrepancy
between how the images appear in IE7 and FF2,
e.g. for <IMG SRC="image.php?param=foo">.

Namely, they appear just fine in Firefox but
in IE nothing appears at all.

Can anyone tell me know how to make this work
and whether this is a browser issue, a PHP issue,
or what?

In certain php image manipulations, different code is required for
ie than is for other browsers.

I've never seen that. How so?

Har har, you know not what you ask...

No, I know EXACTLY what I ask. You have no idea what you're saying.

Oh quit being such an asshole.

You should really learn what you're talking about. Idiot.

Quote:
Anyway, _I_ don't know where in that labyrinth of a php manual you'll
find this (-if anywhere), but I'm tired of wasting my own time. This
line from the code of one of my old pages:

if (!($_FILES['filup']['type'] == "image/jpeg" ||
$_FILES['filup']['type'] == "image/pjpeg")) {

...rather explains it.

An image of an unknown type is uploaded. Determining the type
produces different matches on different platforms; "image/pjpeg" on
Windows and "image/jpeg" on non-Windows. This particular code-bit
came from a page receiving images posted by form. Whether it matters
elsewhere and otherwise, who knows. Have a nice day.

Nope, it explains your code is broken. NEVER rely on the type of
image indicated by the upload. Check it yourself. You will get the
same type on ALL platforms.

Not hardly. I _have_ checked it. Come back when you know what you're
talking about.

I do know what I'm talking about. A lot more than you, obviously. I
pity your customers.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================



Reply With Quote
  #14  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 07:32 AM



Neredbojias wrote:
Quote:
On 21 Mar 2008, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

In article <Xns9A68D85604297neredbojiasnano (AT) 85 (DOT) 214.90.236>,
Neredbojias <example (AT) example (DOT) com> wrote:

Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it...
no... surely not... the lovely, sensitive, Jerry Stuckle? Is this
character doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to
waste your energy. He just pisses and has wooden spiels. Telling
him to quit this would be like trying to get Saddam to personally
make and serve breakfast to a Kurd or a Marsh Arab instead of
say, gassing them.

But but but - Michael Fesser and he are in agreement. Er, sort of.
However, I really think ol' Jer is just parroting one side of an argument
just to stroke the ol' ego, so to speak. I don't give a shit, nor will I
take it; it's no more Mr. Nice Guy from now on. I know what I can do, and
while not perfect, my output beats most anything from anybody else that
I've seen. Another thing is it's fine to criticize, but without providing
some truly _constructive_ information in the process, you're just blowing
your own horn. And to wit, there are a lot of horn-blowers here, -even
fairly intelligent ones.

Thanks for the advice, do.

Wrong answer, idiot. I started replying to you even before I saw
Micha's post.

And we're in agreement because we're both right. But you're just an idiot.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================



Reply With Quote
  #15  
Old   
rf
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 08:06 AM



Full quote on purpose!

"Jerry Stuckle" <jstucklex (AT) attglobal (DOT) net> wrote

Quote:
Neredbojias wrote:
On 21 Mar 2008, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

In article <Xns9A68D85604297neredbojiasnano (AT) 85 (DOT) 214.90.236>,
Neredbojias <example (AT) example (DOT) com> wrote:

Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it... no...
surely not... the lovely, sensitive, Jerry Stuckle? Is this character
doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to waste
your energy. He just pisses and has wooden spiels. Telling him to quit
this would be like trying to get Saddam to personally make and serve
breakfast to a Kurd or a Marsh Arab instead of say, gassing them.
But but but - Michael Fesser and he are in agreement. Er, sort of.
However, I really think ol' Jer is just parroting one side of an argument
just to stroke the ol' ego, so to speak. I don't give a shit, nor will I
take it; it's no more Mr. Nice Guy from now on. I know what I can do,
and while not perfect, my output beats most anything from anybody else
that I've seen. Another thing is it's fine to criticize, but without
providing some truly _constructive_ information in the process, you're
just blowing your own horn. And to wit, there are a lot of horn-blowers
here, -even fairly intelligent ones.

Thanks for the advice, do.
In this particular case I do really think Neredbojias is actually wrong.
Sorry mate but you really should not look at what the browser (or whatever)
says, you should look inside the file you receive.

However:

Quote:
Wrong answer, idiot. I started replying to you even before I saw Micha's
post.
A typical Stuckle post. If anybody disagrees then he is an idiot.

If anybody has a different opinion then he is an idiot.

Even if that opinion may be based on, to the anybody, quite reasonable
assumptions, he is still an idiot.

Is this the start of yet another of your bloody pissing contests Stuckle?

I pity your customers Stuckle. They must be yellow, after all the pissing
contests they must have had with you!




Reply With Quote
  #16  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 08:45 AM



ur.solame (AT) yahoo (DOT) com wrote:
Quote:
I have an image being generated by a PHP script--
I didn't write the code-- and the image itself is in a
database.

I've discovered that there is a big discrepancy
between how the images appear in IE7 and FF2,
e.g. for <IMG SRC="image.php?param=foo">.

Namely, they appear just fine in Firefox but
in IE nothing appears at all.

Can anyone tell me know how to make this work
and whether this is a browser issue, a PHP issue,
or what?

This works for me in both.


Obviously there are some bits missing, but the generic header shape is
probably what you want.

image.php
=========

<?php
$id=$_GET['id'];
$query="select picture, picture_filename, picture_size from product
where id='".$id."'";
//echo $query;
$result=mysql_query($query);
if(($result>0) && (($rows=mysql_numrows($result)) == 1)) //got some data
{
$name=mysql_result($result,0,'picture_filename');
$content=mysql_result($result,0,'picture');
$size=mysql_result($result,0,'picture_size');
}
else die();
if ($name="") die();


$mtype=get_mime($name);
header("Content-Type: ".$mtype);
print $content;
?>


mimelib.php
===========

<?php
// looks up mime type in /etc/mime.types and returns the type, or a
default if unmatched
// makes no attempt to interrogate the file content as such.
// THIS NEEDS MORE WORK!!! it doesn't get all types..espcially DWG/DXF!!
// Mind you we don't want to invoke plug-ins for these..
function get_mime($filename)
{
$default="application/force-download";
// first extract the extension
$array=explode(".",$filename); // split the name into the bits
separated by periods
$count=count($array);
if ($count<2) // if there IS NO extension..
return $default; // and let the user sort it out.
$ext=$array[$count-1]; // it will be the last element in the array..
$fp=fopen("/etc/mime.types", "r");
if(!$fp) return ($default); // no /etc/mime.types file
while (!feof($fp))
{
$buffer = fgets($fp, 128);
if (ctype_space($buffer{0}) || $buffer{0}=='#' || $buffer{0}=='\n')
continue; // skip empty lines. or lines starting with spaces
or hashes
sscanf($buffer, "%s %s %s %s %s %s \n",$mime_type,$extension,
$extension1, $extension2, $extension3, $extension4);
if ($ext==$extension || $ext==$extension1 || $ext==$extension2 ||
$ext==$extension3 || $ext==$extension4 )
{
fclose ($fp);
return($mime_type);
}
}
fclose($fp);
return $default;
}


However it WON'T work if invoked directly..it has to be invoked inside
an IMG tag..





Reply With Quote
  #17  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 03:18 PM



rf wrote:
Quote:
Full quote on purpose!

"Jerry Stuckle" <jstucklex (AT) attglobal (DOT) net> wrote in message
news:tY6dnSLza5XWc3nanZ2dnUVZ_jGdnZ2d (AT) comcast (DOT) com...
Neredbojias wrote:
On 21 Mar 2008, dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

In article <Xns9A68D85604297neredbojiasnano (AT) 85 (DOT) 214.90.236>,
Neredbojias <example (AT) example (DOT) com> wrote:

Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it... no...
surely not... the lovely, sensitive, Jerry Stuckle? Is this character
doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to waste
your energy. He just pisses and has wooden spiels. Telling him to quit
this would be like trying to get Saddam to personally make and serve
breakfast to a Kurd or a Marsh Arab instead of say, gassing them.
But but but - Michael Fesser and he are in agreement. Er, sort of.
However, I really think ol' Jer is just parroting one side of an argument
just to stroke the ol' ego, so to speak. I don't give a shit, nor will I
take it; it's no more Mr. Nice Guy from now on. I know what I can do,
and while not perfect, my output beats most anything from anybody else
that I've seen. Another thing is it's fine to criticize, but without
providing some truly _constructive_ information in the process, you're
just blowing your own horn. And to wit, there are a lot of horn-blowers
here, -even fairly intelligent ones.

Thanks for the advice, do.

In this particular case I do really think Neredbojias is actually wrong.
Sorry mate but you really should not look at what the browser (or whatever)
says, you should look inside the file you receive.

However:

Wrong answer, idiot. I started replying to you even before I saw Micha's
post.

A typical Stuckle post. If anybody disagrees then he is an idiot.

If anybody has a different opinion then he is an idiot.

Even if that opinion may be based on, to the anybody, quite reasonable
assumptions, he is still an idiot.

Is this the start of yet another of your bloody pissing contests Stuckle?

I pity your customers Stuckle. They must be yellow, after all the pissing
contests they must have had with you!



You're nothing but a troll - as proven by your post. It has absolutely
no redeeming value. Like you.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================



Reply With Quote
  #18  
Old   
mynameisnobodyodyssea@googlemail.com
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 03-22-2008 , 08:01 PM



On Mar 21, 12:10 pm, ur.sol... (AT) yahoo (DOT) com wrote:
Quote:
I have an image being generated by a PHP script--
I didn't write the code-- and the image itself is in a
database.

I've discovered that there is a big discrepancy
between how the images appear in IE7 and FF2,
e.g. for <IMG SRC="image.php?param=foo">.

Namely, they appear just fine in Firefox but
in IE nothing appears at all.

Can anyone tell me know how to make this work
and whether this is a browser issue, a PHP issue,
or what?
Try a version of your script image.php
with the name of an image file hard-coded in the script,
and not to need a query string,
and see if it works,
to try to localize the error.


Reply With Quote
  #19  
Old   
AnrDaemon
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 04-12-2008 , 07:53 AM



Greetings, Jerry Stuckle.
In reply to Your message dated Sunday, March 23, 2008, 00:18:23,

Quote:
Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it... no...
surely not... the lovely, sensitive, Jerry Stuckle? Is this character
doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to waste
your energy. He just pisses and has wooden spiels. Telling him to quit
this would be like trying to get Saddam to personally make and serve
breakfast to a Kurd or a Marsh Arab instead of say, gassing them.
But but but - Michael Fesser and he are in agreement. Er, sort of.
However, I really think ol' Jer is just parroting one side of an argument
just to stroke the ol' ego, so to speak. I don't give a shit, nor will I
take it; it's no more Mr. Nice Guy from now on. I know what I can do,
and while not perfect, my output beats most anything from anybody else
that I've seen. Another thing is it's fine to criticize, but without
providing some truly _constructive_ information in the process, you're
just blowing your own horn. And to wit, there are a lot of horn-blowers
here, -even fairly intelligent ones.

Thanks for the advice, do.

In this particular case I do really think Neredbojias is actually wrong.
Sorry mate but you really should not look at what the browser (or whatever)
says, you should look inside the file you receive.

However:

Wrong answer, idiot. I started replying to you even before I saw Micha's
post.

A typical Stuckle post. If anybody disagrees then he is an idiot.

If anybody has a different opinion then he is an idiot.

Even if that opinion may be based on, to the anybody, quite reasonable
assumptions, he is still an idiot.

Is this the start of yet another of your bloody pissing contests Stuckle?

I pity your customers Stuckle. They must be yellow, after all the pissing
contests they must have had with you!

You're nothing but a troll - as proven by your post. It has absolutely
no redeeming value. Like you.
Can I remember a CLI vs. CGI thread to You?


--
Sincerely Yours, AnrDaemon <anrdaemon (AT) freemail (DOT) ru>



Reply With Quote
  #20  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: IE not showing PHP-generated images, but Firefox does. - 04-12-2008 , 09:07 AM



AnrDaemon wrote:
Quote:
Greetings, Jerry Stuckle.
In reply to Your message dated Sunday, March 23, 2008, 00:18:23,

Oh quit being such an asshole.
Surely you are not referring to... no... I can't believe it... no...
surely not... the lovely, sensitive, Jerry Stuckle? Is this character
doing his usual pissing competition antics?

Boji, let me give you some advice. He is not competitor enough to waste
your energy. He just pisses and has wooden spiels. Telling him to quit
this would be like trying to get Saddam to personally make and serve
breakfast to a Kurd or a Marsh Arab instead of say, gassing them.
But but but - Michael Fesser and he are in agreement. Er, sort of.
However, I really think ol' Jer is just parroting one side of an argument
just to stroke the ol' ego, so to speak. I don't give a shit, nor will I
take it; it's no more Mr. Nice Guy from now on. I know what I can do,
and while not perfect, my output beats most anything from anybody else
that I've seen. Another thing is it's fine to criticize, but without
providing some truly _constructive_ information in the process, you're
just blowing your own horn. And to wit, there are a lot of horn-blowers
here, -even fairly intelligent ones.

Thanks for the advice, do.
In this particular case I do really think Neredbojias is actually wrong.
Sorry mate but you really should not look at what the browser (or whatever)
says, you should look inside the file you receive.

However:

Wrong answer, idiot. I started replying to you even before I saw Micha's
post.
A typical Stuckle post. If anybody disagrees then he is an idiot.

If anybody has a different opinion then he is an idiot.

Even if that opinion may be based on, to the anybody, quite reasonable
assumptions, he is still an idiot.

Is this the start of yet another of your bloody pissing contests Stuckle?

I pity your customers Stuckle. They must be yellow, after all the pissing
contests they must have had with you!

You're nothing but a troll - as proven by your post. It has absolutely
no redeeming value. Like you.

Can I remember a CLI vs. CGI thread to You?


What a fucking idiot. And a troll to boot.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.