简体   繁体   English

元素“form”上属性“action”的错误值:路径段中的非法字符:“<”是不允许的

[英]bad value for attribute "action" on element "form": illegal charachter in path segment: "<" is not allowed

From the w3 validator来自 w3 验证器

bad value for attribute "action" on element "form": illegal character in path segment: "<" is not allowed.元素“form”上的属性“action”的错误值:路径段中的非法字符:“<”是不允许的。

This is sending me nuts!这让我发疯了! I am trying to find the mistake already two hours but all seems fine.我试图在两个小时内找到错误,但一切似乎都很好。

    <form id="contact" method="post" action="<?PHP echo htmlspecialchars($_SERVER['PHP_SELF']);?>" accept-charset="UTF-8">

illegal character in path segment: "<" is not allowed.路径段中的非法字符:“<”是不允许的。 I tried to find the w3school error but haven't find the solution yet.我试图找到 w3school 错误,但还没有找到解决方案。 Help is greatly appreciated.非常感谢帮助。

The PHP code should not go through the validator. PHP 代码不应通过验证器。 You should take the HTML output (after it's been processed by the PHP interpreter) and put that into the validator.您应该获取 HTML 输出(在它被 PHP 解释器处理后)并将放入验证器中。

If that's the actual code that gets send to your browser, you should probably check your server setup as PHP does not seem to be processing the page.如果这是发送到您的浏览器的实际代码,您可能应该检查您的服务器设置,因为 PHP 似乎没有处理该页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM