Welcome Guest, Not a member yet? Register   Sign In
Validation tutorial
#6

It always execute it no matter what. It dosen't check if you posted any data. Haven't looked in the code in depth if you can actually fix it.

I added this to "fix" the problem. If it's a get request, don't try to look for $_POST and validate it.

PHP Code:
if(
    
$this->request->getMethod() === 'get' ||
    ! 
$this->validate([])
)
{

}
else
{
    

Reply


Messages In This Thread
Validation tutorial - by Codinglander - 04-22-2020, 10:48 PM
RE: Validation tutorial - by Leo - 04-23-2020, 02:51 AM
RE: Validation tutorial - by Codinglander - 04-23-2020, 03:17 AM
RE: Validation tutorial - by jreklund - 04-23-2020, 11:31 AM
RE: Validation tutorial - by Codinglander - 04-23-2020, 07:49 PM
RE: Validation tutorial - by jreklund - 04-24-2020, 09:40 AM
RE: Validation tutorial - by Codinglander - 04-24-2020, 11:12 AM
RE: Validation tutorial - by jreklund - 04-24-2020, 11:21 AM
RE: Validation tutorial - by hugoafr - 07-01-2020, 01:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB