|
-
Aug 14th, 2006, 07:51 AM
#1
Thread Starter
Hyperactive Member
Access Image Files
When I am accesing image by following code it will be succedded.
<?php
echo getcwd()."/zodiac/Gemini.jpg";
?>
But when I am accesing the following code then after "hello", the image is not coming, instead alphaneumeric characters are coming.
<?php
echo "hello <br>";
echo getcwd()."/zodiac/Gemini.jpg";
?>
Please show me the reason and rewrite the code.
-
Aug 14th, 2006, 10:15 AM
#2
Re: Access Image Files
Are you telling us that the first script actually results in the browser displaying the image? I don't believe it.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Aug 15th, 2006, 06:59 AM
#3
Re: Access Image Files
an image is a data stream, use file_get_contents() to read the file and then output it. Make sure you send the right MIME type header first.
-
Aug 16th, 2006, 03:11 AM
#4
Re: Access Image Files
 Originally Posted by systech44
When I am accesing image by following code it will be succedded.
No it won't, it will print the path of the file.
 Originally Posted by systech44
But when I am accesing the following code then after "hello", the image is not coming, instead alphaneumeric characters are coming.
You cannot snd text with an image. You are not even opening the images. All you'll get is the path of the images printed on the page.
If you want to know how to display text and an image, I suggest you learn HTML.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|