Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 26-11-2007, 12:21 PM   #1 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Red face PHP problem with firefox


First, here is the piece of code:
Code:
<img src="images\<?php echo $row_Recordset1['photo']; ?>" />
my images are stored in a folder called "images" and file names are stored in a database. the recoedset1 gets the image name from the database.

Now the problem is, Internet Explorer 7 is displaying the image but Firefox is NOT. I absolutely have no clue whats wrong.. When I view the source code for both IE and FF, both are same
Code:
<img src="images\383huge.jpg" />
Then why the image is not being displayed?
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.
amitava82 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 26-11-2007, 03:00 PM   #2 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: PHP problem with firefox

Shouldn't the slash be the other way ( / )?

Edit: Confirmed, your slash is the mistake. IE's just being stupid.
__________________
Harsh J
www.harshj.com

Last edited by QwertyManiac; 26-11-2007 at 03:06 PM.
QwertyManiac is offline  
Old 26-11-2007, 03:48 PM   #3 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Default Re: PHP problem with firefox

Nope.. not working. But interesting thing I have found that FF is converting the "\" into Escape code "%5C". but why?
Code:
http://gbsa.clanteam.com/images%5C9215image2.jpg
actual file name is 9215image2.jpg
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.
amitava82 is offline  
Old 26-11-2007, 04:05 PM   #4 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: PHP problem with firefox

\ is for escaping ALWAYS isn't it? Its a common HTML error people make in mixing up the slashes.

Putting / still doesn't make it work?
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 26-11-2007, 04:16 PM   #5 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Default Re: PHP problem with firefox

Nope... Very weird..
I've worked around a temporary solution by defining two PHP variables, one with a value of "images/" and another with the image name from database then adding them in image src.. It works. But what could be the problem!
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.

Last edited by amitava82; 26-11-2007 at 04:21 PM.
amitava82 is offline  
Old 26-11-2007, 04:28 PM   #6 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: PHP problem with firefox

Try making your function return with images/ prefixed?

(I mean, modify the echo part)

No idea, but putting a \<tag> in any string will result as &gt;tag> or something like it cause \[anything] is an escape sequence globally.
__________________
Harsh J
www.harshj.com

Last edited by QwertyManiac; 26-11-2007 at 04:28 PM. Reason: Automerged Doublepost
QwertyManiac is offline  
Old 26-11-2007, 05:57 PM   #7 (permalink)
Right Off the Assembly Line
 
Join Date: Nov 2007
Posts: 8
Default Re: PHP problem with firefox

even if the browser converts the string, the file should be able to be accessed.

where is your script located and where is the images located ?
Say this is your directory structure
xyz
-->images/
-->script.php

then you can specify the code in php script as ./images/ or images/
it should work, infact it works for me on firefox 2.0.0.9
__________________
BSNL Launched EVDO / 3G service in India. Checkout updates on it @ www.bsnlevdo.com
ashokjp is offline  
Old 26-11-2007, 10:13 PM   #8 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Default Re: PHP problem with firefox

Its a firefox bug.. Both IE and opera are working fine..
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.
amitava82 is offline  
Old 29-11-2007, 02:36 PM   #9 (permalink)
Right Off the Assembly Line
 
jaya's Avatar
 
Join Date: Aug 2005
Location: Allappy
Posts: 12
Smile Re: PHP problem with firefox

Quote:
Originally Posted by amitava82
Its a firefox bug.. Both IE and opera are working fine..
Please change your code like and test This code may be work
<?php
$image=$row_Recordset1['photo'];
$image_size =@getimagesize($image);
?>
<img src="images/<?php echo $image; ?>" <?php echo $image_size[3];?> />
__________________
jayadev
jaya is offline  
Old 29-11-2007, 03:59 PM   #10 (permalink)
MMO Addict
 
amitava82's Avatar
 
Join Date: Jul 2004
Location: Bangalore
Posts: 1,474
Default Re: PHP problem with firefox

Well, finally what I have found that this has nothing to do with PHP code. Both are fine. The problem is with file name. My test file name is "
102_1600x12001.jpg". If I upload this file, FF is not showing the image but both opera and IE are fine. Now when I remove the 'x' part of the file name everything works great. Even if i place the x anywhere in the filename say "102x_16001200.jpg" it works fine. Its so weird..
__________________
Steam Profile || Personal Page
Warp drive active. Approaching stargate.
amitava82 is offline  
Old 29-11-2007, 05:18 PM   #11 (permalink)
Web Junky 2.0
 
debiprasad_sahoo's Avatar
 
Join Date: Oct 2005
Location: Chennai, Cuttack
Posts: 121
Default Re: PHP problem with firefox

What QwertyManiac saying is right. The problem is with '\' (what you are using in your code). You have to use '/' in any http request path. IE is that compatible so it displays your image, but FF can't. Please change your code. Replace '\' by '/' in http path. This is not even a bug of FF.
__________________
More reason to love orkut
Get Scraps, Testimonials and many more...
http://loveorkut.com/
debiprasad_sahoo is offline  
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox problem , please help me ... gsmsikar Internet & WWW 8 27-11-2007 01:43 AM
firefox problem vicky_l7 Internet & WWW 5 04-09-2007 03:26 PM
Problem with Firefox 1.0.6 lahratla Internet & WWW 2 06-08-2005 04:36 PM
firefox problem sanjeev choudhary Internet & WWW 3 03-04-2005 08:40 PM
PROBLEM WITH FIREFOX ??? neerajvohra Software Q&A 2 17-01-2005 12:02 AM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:44 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2