Computing.Net > Forums > Web Development > No Images, Text Wrong, Moved HTM

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

No Images, Text Wrong, Moved HTM

Reply to Message Icon

Name: Pete2008 (by Steven2008)
Date: September 25, 2006 at 03:16:22 Pacific
OS: xp
CPU/Ram: 1024
Product: Targa
Comment:

Hi I moved a htm file from an incorrect directory then uploaded it. Now the page has lost all its images (just templates) and the text is all wrong. The file that is in the wrong directory looks fine. I need to change it to the correct directory though with all the images and correct text. How can I do this?



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: September 25, 2006 at 08:23:31 Pacific
Reply:

When you mioved the file the path to the images changed. Did you enter the path yourself or are you using an HTML editor that created the paths to the images?

If you are using an HTML editor for placing the images you need to go back in and replace the images. If the code was written with a text editor you will need to modify those paths individually.

The fact that the text is wrong makes me believe that the "text" for the page is in an external file as well. Could you provide links tot he old and new pages?

Michael J


0

Response Number 2
Name: Pete2008 (by Steven2008)
Date: September 25, 2006 at 10:58:01 Pacific
Reply:

I had to input the paths to where the photos were individually and all the images appeared again. Is there anyway of copying a webpage to another location without having to change all the paths?


0

Response Number 3
Name: Michael J (by mjdamato)
Date: September 25, 2006 at 12:03:42 Pacific
Reply:

Yes and no. Depends on the situation. If you are using a robust HTML editor, it should take care of this for you.

However I use text editors. If you are doing the same, then your best option is to include the FULL path to the images instead of just the relative path. For example let's say you have the site "mysite.com" and you have an htm file in the root of the folder. Then you have an images directory in the root as well. Then you *could* make your paths like this:

src="images/imagename.jpg"

But, then if you moved that htm file to a subfolder (say called "contact") then thos image paths would no longer work. The new relative path would be "./images/imagename.jpg". To get around this just use the full path to the images:

src="http://mysite.com/images/imagename.jpg"

Then, no mater where you relocate the htm files they will always point to the images correctly.

The downside to this is that working with these files on your local PC can be a problem unless you run a local web service - since if you run the htm file locally it will look for the images online.

One last option is if you were to use a server side scripting language such as PHP. Then you could create a variable that has the path tot he images directory. This is what I use a lot for code that will be ported to several sites.

Michael J


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: No Images, Text Wrong, Moved HTM

No images on Firefox www.computing.net/answers/webdevel/no-images-on-firefox/514.html

Problem with an image gallery code www.computing.net/answers/webdevel/problem-with-an-image-gallery-code/2182.html

how to display images in PHP www.computing.net/answers/webdevel/how-to-display-images-in-php-/2164.html