anon
anon

Reputation:

W3C Markup Validation - Illegal character in PHP query: not a URL code point

What's the problem?

I am currently trying to validate my client's website, but cannot resolve the following issue.

Bad value /php/captcha_code_file.php?rand= for attribute src on element img: Illegal character in query: not a URL code point.

The full line that the validator points to can be found below.

<html>
<!-- ... -->
<img src="/php/xyz.php?rand=<?php echo rand();?>" id="captchaimg" alt="captcha"><br/>
<!-- ... -->
</html>

What have I done?

It's my understanding that any spaces in URLs are to be replaced with %20, but I can't imagine that would be the problem inside the actual query - especially since I've tried this already and received the same error.


Edit: My question is not about validating the PHP the src property is pointing to, but rather how the value/string is formatted for src.

Upvotes: 0

Views: 470

Answers (1)

Quentin
Quentin

Reputation: 943568

You have given the validator the source code to a PHP program, when you should be giving it the HTML document you get when you run the PHP program.

It is a markup validator, not a PHP source code validator.

Upvotes: 2

Related Questions