php comment validation

For technical support for all editions of CSE HTML Validator. Includes bug reports.

php comment validation

Postby CA Traveler » Tue Aug 30, 2011 5:14 pm

Why does the following which is a comment in a php file get flagged as a error starting with <head> ?

/*

Cookie requirement. If you enable this the script will first check for the existence of a cookie. If the cookie does not exist, the script will exit, an error message will be issued and the email will not be sent. This is a very useful feature as it will block some spam bots. If this is enabled, the user (your website visitor) must have cookies enabled on their browser. To use this feature you must set a cookie on the page that the form is on. If it is on an HTML page you can set the cookie by putting this line in the <head></head> section: <meta http-equiv="Set-Cookie" content="formtoemailpro=1">

If the form is on a PHP page, you can set the cookie by entering this code on the page (before any output - usually near the top): setcookie('formtoemailpro',1);

To require a cookie, change the value to 1, like so: $require_cookie = 1;

*/
CA Traveler
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 7
Joined: Tue Aug 30, 2011 5:05 pm

Re: php comment validation

Postby Albert Wiersch » Tue Aug 30, 2011 8:09 pm

Is the PHP comment in a <?php ... ?> section to designate that is it PHP code?

If that's not the problem, then it may be necessary to see the entire document, but I hope this helps.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: php comment validation

Postby CA Traveler » Wed Aug 31, 2011 7:11 am

Yes, the comment is in <?php ... ?>
This is a long php file that processes a form and contains a lot of comments to document the operation.

Some of the comment lines are over 1000 characters. Is that part of the problem?

Besides the comment errors there are a number of other errors and warnings. I can send the file, how do I do that?
CA Traveler
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 7
Joined: Tue Aug 30, 2011 5:05 pm

Re: php comment validation

Postby Albert Wiersch » Wed Aug 31, 2011 8:43 am

Hello,

Please zip the file and send it to me via email attachment to support at htmlvalidator dot com.

In the email, please also copy & paste the text of the error message(s) you think are in error.

Thank you.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: php comment validation

Postby Albert Wiersch » Wed Aug 31, 2011 11:55 am

Hello,

Thanks. I got the file via email.

I think the problem is that in the documentation there are "?>" sequences in the example PHP code which improperly (prematurely) end the PHP section. If you go through and change all of the "?>" strings to "? >" except for the last one that should end the PHP code section (on line 1890 or so), then I think that will solve the problem.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: php comment validation

Postby CA Traveler » Thu Sep 01, 2011 10:05 am

Thanks, that worked.
CA Traveler
Rank 0 - Newcomer
Rank 0 - Newcomer
 
Posts: 7
Joined: Tue Aug 30, 2011 5:05 pm


Return to CSE Tech Support

Who is online

Users browsing this forum: No registered users and 2 guests