Malformed HTML at submitted $_POST variable resulting to 403 Forbidden Error

I just found out that malformed html tags when submitted through form may result to 403 Forbidden error and redirect to current page like as if nothing has happened.

My question is how can i catch that error in controller’s action and save it on a flash so i can notify user that they are submitting a malformed html?

I don’t think that it should reach the controller before detecting that the submitted HTML is malformed. Use a client-side HTML parser, like Pure Javascript HTML parser.

The only problem is when the browser’s javascript is disabled. In that case, forget the javascript HTML parser and create a method or function that will check the correctness of the HTML submitted.

How could server return error 403 for malformed html? But anyway for validation valid HTML maybe this can help??

HTML Validator for PHP

It is PHP-based html validator.

Why is my post quoted?

Just wondering. :)

Nothing. I hit “reply” button below your post that’s why it quote your post :P

My bad…

Haha! Nah, I just wondered. No worries :)

Another 403 experience.

I am posting a 50+ sentences using cleditor and it return a 403 error (can only be seen using firebug).

The form is working fine so i know it has something to do with the data.

I submit sentences one by one until i reached the sentence that return 403 error.

When i reached that sentence i discovered it was the word b[/b] that gives me a headache for a day.

This is my problem too

I can’t insert words “Search Engine Optimization” and “Electronic Cigarette” on my form (method=post).

I have 2 shared hosting accounts, when I tested on hostgato* that works fine but when I test on another one it return 403 Forbidden.


Hi guys. I too am facing the same problem where some words cause my form to throw 403 Forbidden. I’m using a shared webhost in Australia, so could it be an .htaccess level issue? Could anyone figure this out.

Thanks in advance…