New to the formum so not sure if this is the right one to air this issue.
I have just taken over the maintanence of a site which nicely emails all its problems to me. I now have a series of problems that I cannot find the cause. They have a common theam, that is a user form is completed and one or more of the form elements is missing from the POST result, which causes the php script to raise an exception. Now the client side has js form validation in that it checks all elements that should have a value do have. I cannot find any problem in the js other than the page does not check for js disabled. In a couple of cases the element missing is a hidden element and not touched by the js. My js is not the that advanced but the code is not that complicated.
I cannot find any code that changes the values in the $_POST variable.
Anybody any ideas?
A problem of disappering POST's
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: A problem of disappering POST's
Maybe a spammer or bot is posting data directly to your processing page and bypassing the form? This is fairly common. Do validation in the processing form as well. If required fields, especially your hidden field are missing, then don't process. Whether you raise an exception or not is up to you and whether you want an email when people are trying to spam you.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: A problem of disappering POST's
I do not think it is a SPAMMER as the exception email gives the REFERER and session which all stacks up. The other thing is they occur as once off's ind different places including behind the admin login.
Re: A problem of disappering POST's
You have not provided enough data for us to provide a solution.
Re: A problem of disappering POST's
Not sure what extra data you need. The problem over months has occurred about 10 times, many different forms each time, some behind the admin login. The form fields are standard form elements, a few different types, text, select, hidden. The required fields are all checked by js to have a value on submit.
The PHP script then throws an exception or in some cases unknown offset warning when fields are missing, the resultant emailed dump shows the fields are indeed missing from the $_POST variable.
There is no benefit I believe in showing you the dump or the code. Can the HTTP header get corrupted and just miss out a POST parameter, seems very unlikely to me.
Any ideas appreciated.
The PHP script then throws an exception or in some cases unknown offset warning when fields are missing, the resultant emailed dump shows the fields are indeed missing from the $_POST variable.
There is no benefit I believe in showing you the dump or the code. Can the HTTP header get corrupted and just miss out a POST parameter, seems very unlikely to me.
Any ideas appreciated.