1 of 1 people found this helpful
This is known behavior; usually the CWPE just tries to return all records of the database in case of a (otherwise correct) query in which a field or field value was simply forgotten.
The only way is to identify and correct the wrong URLs. When you test, you may also initially limit the number of returned records using the FM PHP API setRange() function.
CPU overload may also occur when a search engine robot returns with a previously stored URL with a database query, that is
- either malformed
- or is good, but in the meantime the database record has been deleted, so that the query does something unexpected
Hence, it is good practice to check all query parameters in the $_REQUEST variable, e.g. by using the PHP array_key_exists(), and also check the validity (format, scope) of the query parameter values.
I think I have published something on misbehavior of web robot queries years ago in TechTalk or on fmforums.com, but don't find that post anymore.
See also this TechTalk archive message somewhat related to this.
It sounds like you are suggesting that my memory may be incorrect (happens all the time), that this behavior was probably occurring regularly with my development server.
Anyway, the use of setRange() and array_key_exists() sounds wise. The PHP function array_key_exists would definitely test a GET request adequately. So we can kill the page if the query lacks the suffix params. With a POST, doesn't array_key_exists yield true, since the key is there whether or not a value has been posted?
Yes, but then you can check the value using $_REQUEST['your_parameter_name'] .