简体   繁体   English

W3C验证查询中的非法字符:不是URL代码点

[英]W3C validation Illegal character in query: not a URL code point

The w3C validator has found an error in my HTML: w3C验证器在我的HTML中发现了一个错误:

Bad value comment_add.php?id= 7 for attribute action on element form: Illegal character in query: not a URL code point. 对于元素表单上的属性操作,错误值为comment_add.php?id = 7:查询中的非法字符:不是URL代码点。

It marked the closing ">" tag as a problem 它将结束“>”标记标记为问题

<form method="post" action="comment_add.php?id= 7"**>**

The code which generated that HTML is: 生成该HTML的代码是:

<form method="post" action="comment_add.php?id=<?= $id_post;?>">

I have a few other lines with the same issue. 我还有一些其他问题也存在同样的问题。

How can I solve this problem? 我怎么解决这个问题?

There should not be any spaces in the action of the form. 表格的动作中不应有任何空格。

You should change your code to: 您应该将代码更改为:

<form method="post" action="comment_add.php?id=<?=$id_post;?>">

If you need a space in your URL is should be encoded as %20 . 如果您的网址中需要空格,则应将其编码为%20 So the code would then look like: 所以代码看起来像:

<form method="post" action="comment_add.php?id=%20<?=$id_post;?>">

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

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