473,811 Members | 2,850 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: <img> can't seem to find the file

Puzzled wrote:
echo '<img src="/usr/local/yaddayadda/filename.jpg" alt="not
found">' ;
I hope I'll understand it in the right way.
You browse your website http://www.example.com with a webbrowser. In the
source of it is written by PHP
<img src="/usr/local/yaddayadda/filename.jpg" alt="not found">

So your brwoser is asking the webserver for
http://www.example.com/usr/local/yad...a/filename.jpg

But I think it will be not the correct path because it seems to be a
complete unix-path starting from root. PHP will not deliver the picture it
self but only the relative path to it. (or relative path according to your
web root)
Sven Reuter
--
http://www.sReuter.net/
http://www.Auskennbert.de/
Nov 6 '08 #1
2 1797
Sven Reuter wrote:
But I think it will be not the correct path because it seems to be a
complete unix-path starting from root. PHP will not deliver the picture
it self but only the relative path to it. (or relative path according to
your web root)
=(or absolute path according to your web root)

Sorry.
Sven Reuter
--
http://www.sReuter.net/
http://www.Auskennbert.de/
Nov 6 '08 #2
Puzzled <sc************ *@example.comwr ote:
On Thu, 06 Nov 2008 21:36:16 +0100,
"Sven Reuter" <ne************ *@sreuter.netwr ote:
>>Puzzled wrote:
>>echo '<img src="/usr/local/yaddayadda/filename.jpg" alt="not
found">' ;
I hope I'll understand it in the right way.
You browse your website http://www.example.com with a webbrowser. In the
source of it is written by PHP
<img src="/usr/local/yaddayadda/filename.jpg" alt="not found">

So your brwoser is asking the webserver for
http://www.example.com/usr/local/yad...a/filename.jpg

But I think it will be not the correct path because it seems to be a
complete unix-path starting from root. PHP will not deliver the picture it
self but only the relative path to it. (or relative path according to your
web root)
Sven Reuter

Tak så mycket! (Or recht schön Dank, depending on whether you're
ethnically big-endian or little-endian :-)

I got confused because Apache will accept absolute paths for
config instructions etc.
Apache will accept absolute paths for just about anything IF you've
configured it that way.

The normal default is to not serve pages/images not under the root.
--
Jim Pennino

Remove .spam.sux to reply.
Nov 6 '08 #3

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

Similar topics

15
3099
by: Philipp Lenssen | last post by:
My friend has the following problem (background: we want to transform XML to XHTML via XSLT): "We copy XHTML fragments into an output by using the following template: <xsl:template match="*" mode="xhtml"> <xsl:element name="{local-name()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="xhtml"/> </xsl:element>
9
72126
by: Wladimir Borsov | last post by:
As well known for <IMG ...> tags in web pages a width and a height attribute can be applied. What I want to do now is to fix the width for ALL the images on my web page to exactly lets say 70 pixel regardless how big the originals are. The height should be adjusted proportional so that the resulting thumbnail is not distorted. But as far as I know there is no such attribute like <IMG SRC=...... WIDTH=70 HEIGHT="Adjust proportional to...
7
2634
by: Zhang Weiwu | last post by:
Hello. This is problem puzzled me a long time. I wish to organize some block elements and let them flow one after each other like text. Think about a album, I wish the album have 12 thumbnails, each one has a comment line under the picture. And I wish when the screen size is big, this thumbnails arrange 3 rows, 4 columns; if the browser window is smaller, arranges 4 rows, 3 columns; if it's even smaller, 6 rows with 2 columns. If there...
15
122178
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width: 123px; height: 456px;" alt="">
3
5456
by: Henry Johnson | last post by:
Okay - I'm spinning my wheels on this one... can someone help me figure out how to programmatically populate a table cell as follows (from C# code-behind)? I've tried using a Literal control in the TableCell, a HyperLink control, and an Image, but I'm not getting the results I want. Here's the source of what I'm after (retrieved by viewing the source of a page I'm trying to emulate): <td><a...
1
4629
by: Carl | last post by:
Hi all I have a javascript function that drags and drops an element (ie img) into a container (ie bordered div). The function works and returns the element and and container. My next step is to center the element in the container if the user is sloppy with positioning it. I can only test this on IE6 and IE5.5 and it fails. It positions the element too much right and low. Here is the function: function SnapToContainer(Container,El) {
4
9094
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a project where client javascript requests an image server to generate dynamic images. The client...
4
2016
by: Jon Slaughter | last post by:
I have a captcha system going and for some reason when I use <?php $s = ""; for($i = 0; $i < 10; $i++) { $s = $s.rand(0,9); } $_SESSION = $s; $fn = '/Login/Register/Captcha.php'; echo '<img src="'.$fn.'" alt="Captcha" />'; ?>
2
1676
by: Bobby Edward | last post by:
I have a subdirectory with an aspx page that references a master file located in the root. In the master file template I reference a logo/image that is in <root>/resources... <img alt="logo" src="./resources/logo.png" /> For some reason when I pull up the page in the subdirectory it only shows the alt tag because i think it can't find the png. Any idea why?
0
375
by: jimp | last post by:
Puzzled <scratching.head@example.comwrote: Look in the web server log file for errors. Does the web server have permission to that directory? -- Jim Pennino
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10663
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...
1
10416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9217
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
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
2
3881
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3029
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.