$content 1= "亲爱的$username :<br/>感谢您在我站注册了新帐号。<br/>请点击链接激活您的帐号。<br/>";
$content2 = "亲爱的$username :<br/>感谢您在我站注册了新帐号。<br/>请点击链接激活您的帐号。<br/>";
$content 3= "亲爱的$username:<br/>感谢您在我站注册了新帐号。<br/>请点击链接激活您的帐号。<br/>";
输出以上三种,第一种会报 “
未定义变量: username:
”的错误,把冒号换成英文状态下或者在冒号前面加个空格,则不会报错。
1. echo '<script>alert("即将跳转到登录页面!");window.location.href="/home/Login/index";</script>';
2. echo '<script>alert("即将跳转!");window.location.href="http://www.tp5mytest.cn/home/Login/index";</script>';
3. echo "<script>alert('即将跳转到登录页面!');window.location.href=\"{:url('Login/index')}\";</script>";
4. echo '<script>alert("即将跳转到登录页面!");window.location.href="{:url(\'Login/index\')}";</script>';
1 、2 两种运行会成功跳转,3 、4 两种不会成功跳转。