There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Web Design & Development
Tag Cloud
access acer asus batch bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop lcd malware memory modem monitor motherboard network printer problem ram registry router slow software sound toshiba trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless xbox
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: PHP Issue

Reply  
Thread Tools
mrtechnique's Avatar
Computer Specs
Member with 112 posts.
 
Join Date: Jan 2007
Experience: Intermediate
05-Nov-2009, 06:00 PM #1
Solved: PHP Issue
I'm restructuring a website and I am putting .php files in a lower directory than the root directory. My images directory is one level lower than the root directory. Is there a way I can set the image directory to the root image directory. For example, I have a file called golfDevelopment.php stored in the golf-development directory and if it is accessed via the internet, it would be www.mysite.com/directory/file.php. My images directory if accessed would be www.mysite.com/images/. Now if I want to access any images from this file, it would look like this:

<img src="../images/myimage.jpg">

I want to be able to access an image by typing this:

<img src="images/myimage.jpg">

I would like to access my images like this regardless of what level my .php files are on. Can someone help me?
midders's Avatar
Account Closed with 654 posts.
 
Join Date: Dec 1969
05-Nov-2009, 06:23 PM #2
Try using "/images/image1.jpg"; the root directory of your web site can normally be accessed via "/". This is an absolute path, rather than a relative path (e.g. "./" for current directory).

Slainte

midders
mrtechnique's Avatar
Computer Specs
Member with 112 posts.
 
Join Date: Jan 2007
Experience: Intermediate
06-Nov-2009, 01:26 PM #3
That solved my problem. I just had to upload the file to my server first. My local IIS server couldn't do it because I have separate folders for each client's website, so when I used '/images/image.jpg', it would go to http://localhost/images/image.jpg instead of http://localhost/clientfolder/images/image.jpg.
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:45 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.