[英]php code returns error log issue
I have this line in my php file that is returning an error: 我的php文件中有这行返回错误:
echo "<script type=\"text/javascript\">window.locaiton = \"http://www.mywebsite.com/formsubmit.html"\"</script";
and the error log says 并且错误日志说
[20-Apr-2012 13:53:17] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home6/mywebsite/public_html/func2.php on line 455
[20-Apr-2012 13:53:17] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home6/mywebsite/public_html/func2.php on line 455
Im not sure how to fix it. 我不知道如何解决它。 Thanks for any help in advance. 在此先感谢您的帮助。
a) You mistyped location a)您错误输入了位置
b) You've got a " too much. b)你有一个“太多了。
c) You forgot closing the /script tag c)您忘记关闭/ script标记
Try 尝试
echo "<script type=\"text/javascript\">window.location = \"http://www.mywebsite.com/formsubmit.html\";</script>";
window.locaiton
应该
window.location
There is something wrong with you quotes, location and script-closing tag. 引号,位置和脚本结束标记有问题。
formsubmit.html"\"</script";
^ ^
你错过了反斜杠
echo "<script type=\"text/javascript\">window.locaiton = \"http://www.mywebsite.com/formsubmit.html\"\"</script>";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.