?
Solved

How can i chnge code to relative not only 192.168.0.82

Posted on 2005-04-16
2
Medium Priority
?
252 Views
Last Modified: 2010-04-09
The code below is work but if I change the server to 92.168.0.10 I need to change the code form 192.168.0.82 to 192.168.0.10  how can I change the code to use every Ip only I  do that make  a directory the same




<tr>
      <td height="30" bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><a href="http://192.168.0.82/bee/html/account/" target="_parent"><strong>Account</strong></a></font></div></td>
      <td bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><strong><a href="http://192.168.0.82/bee/html/cheque/" target="_parent">Cheque</a></strong></font></div></td>
    </tr>
    <tr>
      <td height="30" bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><strong><a href="http://192.168.0.82/bee/html/credit/" target="_parent">Credit</a></strong></font></div></td>
      <td bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><a href="http://192.168.0.82/bee/html/WebHosF/" target="_parent"><strong>WebHasF</strong></a></font></div></td>
    </tr>
0
Comment
Question by:teera
2 Comments
 
LVL 9

Accepted Solution

by:
lombardp earned 600 total points
ID: 13797601
Before to enter a relative URL, it is important to know which is the location of your page, because relative URLs are "relative" to the location of the page where the URL is placed.

If the above page is located in "html" directory, the first URL "http://192.168.0.82/bee/html/account/"  translates into "account/", while if it is located in the root dir, it translate into "bee/html/account/". Here you find this last case:

<tr>
      <td height="30" bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><a href="bee/html/account/" target="_parent"><strong>Account</strong></a></font></div></td>
      <td bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><strong><a href="bee/html/cheque/" target="_parent">Cheque</a></strong></font></div></td>
    </tr>
    <tr>
      <td height="30" bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><strong><a href="bee/html/credit/" target="_parent">Credit</a></strong></font></div></td>
      <td bgcolor="#FFFFFF">
        <div align="center"><font size="3" face="EucrosiaUPC"><a href="bee/html/WebHosF/" target="_parent"><strong>WebHasF</strong></a></font></div></td>
    </tr>
0
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 600 total points
ID: 13801641
lombardp is perfectly right.

However, you could always use a semi-relative approach where we only requirement is that both html and image are at the same server. We could then make a semi-absolute path to the image where only the server addr is relative:
ie. <a href="/bee/html/account">Account</a>

The / in /bee tells the browser to look for the /bee directory at the root of the server. So in both the file
http://192.168.0.82/bee/html/test1.html as http://192.168.0.82/bee/html/test/test/test/test2.html a link to /bee/html/account would redirect to http://192.168.0.82/bee/html/account.

Having this said, we could make the link "server independant" because <a href="/bee/html/account"> contained in:
- 192.168.0.81/test.html, would link to 192.168.0.81/bee/html/account, where
- 192.168.0.145/test.html, would link to 192.168.0.145/bee/html/account

-r-

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question