Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在数据库中存储一些链接,例如www.google.com。假设从数据库中提取值后,我将其存储在$url. 现在,我正在尝试通过执行设置链接
www.google.com
$url
echo "<a href=$url>link</a>"
现在,问题 - 每当我点击链接时,链接都会转到www.mydomain.com/www.google.com
www.mydomain.com/www.google.com
您必须添加http://到链接的开头。例如:
http://
echo "http://$url";
:)
这可能取决于浏览器,但链接始终是相对的,出站链接应包括正确的http或https协议规范。
http
https