HTML - Php Locations (example Provided)
OK, what i need to know is how to access files in different folders on my website...
for example i have 2 folders inside of my main folder o Main Folder - Sub folder 1 - Sub folder 2 Inside subfolder 1 is my images Inside subfolder 2 is extra html files... o Main Folder - Sub folder 1 ----- +Tutorial.html - Sub folder 2 ----- +image.png i want Tutorial.html to access the images inside subfolder 2, hwo would i do this? i know how to access an item in a subfolder: <img src="./Tutorial.html/image.png"> but my images and my html file are in different folders and i dont want to copy and paste because i want to update my files altogether.. how do i access the files from a different subfolder? Similar TutorialsHey guys, I am trying to insert a picture into a .htm file. However, I want to have my files more organize, so I have put the picture in a seperate folder, inside the folder that the .htm file is in. I used the code that is used to do so, however, when I do so, it shows a broke image file. This is my code: <img src="/images/bob saget.gif" Does anyone have any tips and resolutions to why this isn't working? Thanks, Calum I'm trying to fix up my code a bit so all the files I'm pointing to are relative to the root of the site. Most of my links used to look something like this (all these link examples came from same file)... <link href="css/styles.css" type="text/css" rel="stylesheet"> <script src="scripts/jquery.min.js" type="text/javascript"></script> <?php include('includes/header.html');?> <img src="images/maps/pic1.jpg"> The above was fine as long as my site stayed small, with few pages all in same directory. However, bigger projects require pages in different folders, sometimes in subfolders, yet all these pages share certain characteristics - headers, footers, etc. So I need to start specifying links to those files relative to the root. Here are the same examples, but now starting from the root of my site. They all work, except for my includes. <link href=" / css/styles.css" type="text/css" rel="stylesheet"> <script src=" / scripts/jquery.min.js" type="text/javascript"></script> <?php include(' / includes/header.html');?> <img src=" / images/maps/pic1.jpg"> Any idea why the includes won't work? Works fine as long as I don't put that / in there. I'm building my first real web site and am running into some problems getting the (simple) site to display properly across different browsers. In Firefox and Chrome everything seems to display normally, but in IE the format appears very different from what it should be: the div for the site information links is way out of place, and the left navigation menu is as well. After discovering doctypes I found that using Strict 4.01 eliminated the inconsistencies across browsers, but broke a lot of my formatting and positioning (in particular, margins). I am currently using Transitional. Any recommendations on what could be done would be appreciated. Through searching I have found numerous references to problems with IE using the box model correctly, but that isn't supposed to apply to IE8/IE9. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <meta name="description" content="PAGE DESCRIPTION!"> <link rel="stylesheet" type="text/css" href="mystyle.css"> <script type="text/javascript" src="myscript.js"></script> <title>Index Page!</title> </head> <body> <div id="container" style="background-color:#abc;"> <div id="header"> <h1 style="margin-bottom:0; text-align:center;">Title</h1> </div> <div id="siteinfo"> <div style="margin:10;background-color:#CCCCCC;"> <ul id="thehoriz" style="text-align:center;"> <li class="siteinfo"><a href="site.htm" class=siteinfo>Site</a></li> <li class="siteinfo"><a href="info.htm" class=siteinfo>Info</a></li> <li class="siteinfo"><a href="goes.htm" class=siteinfo>Goes</a></li> <li class="siteinfo"><a href="here.htm" class=siteinfo>Here</a></li> </ul> </div> </div> <div id="menu" style="float:left;width:200px"> <div style="margin-right:10;padding:10;margin-bottom:30;border-right:5px solid;border-bottom:5px solid;;background-color:#EFC700;"> <b>Section 1</b><br> <ul id="thevert"> <li class="tips"><a href="Page 1.htm" class=tips>Home</a></li> <li class="tips"><a href="Page 2.htm" class=tips>News</a></li> <li class="tips"><a href="Page 3.htm" class=tips>Contact</a></li> <li class="tips"><a href="Page 4.htm" class=tips>About</a></li> </ul> </div> </div> <div id="content" style="background-color:#EEEEEE;margin-right:10;padding:10;border:5px solid"> <p>Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here Content goes here </p> <p>Content goes here</p> <p>Content goes here</p> <p>Content goes here</p> <p>Content goes here</p> <p>Content goes here</p> </div> <div id="footer" style="clear:both;"> <div style="margin-top:30px;background-color:#FFA500;text-align:center;"> <p>Copyright (C) 2011 nothing.com</p> <h4>Footer Sample</h4> Page loaded at Tuesday, 04-Oct-2011 15:00:03 PDT </div> </div> </div> </body> </html> |