Home >Backend Development >PHP Tutorial > PHP 页面重定向的有关问题

PHP 页面重定向的有关问题

WBOY
WBOYOriginal
2016-06-13 12:43:171109browse

PHP 页面重定向的问题
$url=$_SERVER['SERVER_NAME']."/login.html";
echo "<script> location.href=$url </script>";


为什么location.href  被赋值为localhost/index.htmllocalhost/login.html
我的意思 是想用变量的方式 把它赋值为localhost/login.html,各位大神们,我该怎么实现!

PHP?提问
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn