简体   繁体   中英

Putting a link from html to a localhost

I would like to put a link in my HTML site to access my database. However, my database is localhost/abc.php (located inside xampp/htdocs).

I was wondering how to add the link because it it a localhost document. I could not do it with the <a href="localhost/abc.php"> or the c:///xampp/htdocs/abc.php .

<a href="localhost/abc.php"> is a relative URL .

It points to a directory named localhost in the directory of the current URL.

You need an absolute URL: http://localhost/...

use

<a href="http://localhost/abc.php">to my db</a> 

that will work.

In detail:

"localhost" is the hostname of the url your are pointing to.

It needs to be prefixed with the protocol you are using. In this case http://

Happy new year.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM