Images not shown in MOZILLA from PHP CODE

JavaScript and client side scripting.

Moderator: General Moderators

eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Images not shown in MOZILLA from PHP CODE

Post by eshban »

I am facing little problem in PHP in MOZILLA BROWSER. IN IE there is no problem

Code: Select all

readfile("C:\\phpdev\\www\\bill\\webpages\\editor\\test_check.html");
i am just reading the file. In mozilla it does not show me images, but in IE it displays as well.

In file test_check.html, i use following syntax, but nonoe of them is working

Code: Select all


<img src="C:\\phpdev\\www\\test\\Water_lilies.jpg" width="100" height="100">
<img src=C:\phpdev\www\test\Winter.jpg width="100" height="100">

Plz guide that how can i fixed this problem in FIREFOX

Regards,
Eshban
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

If I were you I woud use a URL pathname, not a system pathname.
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

i am just running it offline. so [s]plz[/s]please tell me according to that
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Re: Images not shown in MOZILLA from PHP CODE

Post by neel_basu »

eshban wrote:

Code: Select all

<img src="C:\\phpdev\\www\\test\\Water_lilies.jpg" width="100" height="100">
<img src=C:\phpdev\www\test\Winter.jpg width="100" height="100">
Hey I didn't Understand
Why You Are Using It Like This C:\\phpdev\\www\\test\\Water_lilies.jpg
Instead Of C:\phpdev\www\test\Water_lilies.jpg
When You Are Using It In HTML
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

eshban wrote:i am just running it offline. so [s]plz[/s]please tell me according to that
I Would Also Aggre To eshban
To Use Url Path Name You Doesn't Require To Go Online For testing Purpouse
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

file://C:/phpdev/www/test/Water_lilies.jpg is probably safest. btw there is a client side forum for this kind of stuff.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

ole wrote:btw there is a client side forum for this kind of stuff.
Indeed.
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

but still i did not find solution from the reply.
I tested my code with

Code: Select all

C:/a/pic.jpg
but it does not work in mozilla.

plz help
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

did you use file:// ? Because you probably should :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

eshban, stop using aolspeak. I've asked in private messages, now I'm telling you in the forum.

As ole has said, file:// is the proper way to address the local file system.
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

i am sorry sir, i will take care in future.
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

unable to use file:// with readfile function.

i have do in this way.

Code: Select all

readfile("file://C://phpdev//www//bill//webpages//editor//test_beta2.html");
please correct its syntax, and help.

thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You don't normally need file:// with readfile() it interacts with the file system directly. You need file:// for items referenced in the browser.
eshban
Forum Contributor
Posts: 184
Joined: Mon Sep 05, 2005 1:38 am

Post by eshban »

sir, see my question, that what is my problem and what i want
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why do you insist on using file system references? It's far more simple to get the web server to handle them.
Post Reply