Relative Addressing Using Paths

Author Topic: Relative Addressing Using Paths  (Read 789 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 139
  • Karma: 0
    • No Addiction
Relative Addressing Using Paths
« on: 12-19-2015, 02:58:15 »
Let us assume that our web browser is currently pointing to the webpage named index.php on the Erewhon Society website. We will call the directory in which the corresponding fi le is located, i.e. public_html, the current directory . (In this case this is also the home directory for the site.)

We will also assume that the page displayed has a link to another page on the same site, such as main.php in directory buildings. In the HTML for the displayed page the link from index.php to the fi le main.php will either take the form of an absolute link such as .

<a href=""> Click here</a> or a relative link which simplifi es the address to just <a href="buildings/main.php"> Click here</a>

Having clicked on the link to main.php the current directory will now be buildings. If we want to place a link from there to annex.htm we can refer to it by the relative address "annex.htm". Any fi le name written like this is assumed to be in the current directory.

If instead we wished to link to fi le index.php back in directory public_html, we would refer to it as "../index.php". To link to the fi le student.php instead we would write the relative address as "../members/student.php".


Related Topics

  Subject / Started by Replies Last post
0 Replies
Last post 10-20-2013, 06:37:15
by ptbrz86
0 Replies
Last post 12-19-2015, 03:00:43
by chinmay.sahoo
0 Replies
Last post 09-03-2016, 03:44:48
by beingchinmay