Mourning the loss of our friend, WhitPhil.
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 audio black screen blue screen boot bsod connection crash desktop driver drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor ram recovery registry cleaner router safe mode screen slow sound spyware trojan upgrade video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: PHP Issue

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
mrtechnique's Avatar
Computer Specs
Senior Member with 110 posts.
 
Join Date: Jan 2007
Experience: Intermediate
05-Nov-2009, 05: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, 05: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
Senior Member with 110 posts.
 
Join Date: Jan 2007
Experience: Intermediate
06-Nov-2009, 12: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 Bookmark and Share

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 05:52 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.