I know this is pretty simple but I can't find the answer for it..

say you have an link that you want to connect to..

http://example.com/example1/example2/final.com

and you don't want it hard coded cause you have many other links that will use that path.. say..


http://example.com/example1/example2/final1.com

http://example.com/example1/example2/final2.com

how can i get up to the third directory? if just use "/final1.com" it turns out as
"http://example.com/final1.com", it cuts out the other paths..

thanks in advance..

I think you need the <BASE HREF=""> tag. Here you can specify any path and then you hyperlinks wil 'start' from there. Here is an example:

<html>
<head>
 <title>In de weer voor 't klimaat</title>
 <base href="http://example.com/example1/example2/" />
</head>
<body>

 <a href="final.html">This wil open http://example.com/example1/example2/final.html</a>

</body>
</html>

More info can be found at http://www.w3schools.com/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.