Heim >Backend-Entwicklung >PHP-Tutorial > PHP 页面重定向的有关问题

PHP 页面重定向的有关问题

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 12:43:171163Durchsuche

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


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

PHP?提问
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel: 继续php正则,各位大侠帮帮忙 Nächster Artikel: PHP正则小疑点