attacomsian attacomsian - 2 years ago 47
SQL Question

CakePHP 3 Post Method '403 Forbidden'

I came across a really strange issue today and couldn't find any solution. I am using CakePHP 3 along with MySQL and Apache. Everything was working perfect until today but when I tried to edit one of the forum post, it didn't save and I got

403 Forbidden
response. Following is the response I got:

Request URL:
Request Method: POST
Status Code:403 Forbidden

The strange part is that it is working fine when I try to create new forum post as well as for
request when I load the edit page. But when I modify the fields and try to save, I get stuck with
403 Forbidden

I tried every mean in last 6 hours but could not find any solution. I checked database user for edit permissions, tried to remove
file completely, cleared browser cache and cookies but nothing helped at all. The other websites in hosting account are working fine and there is no issue with them.

The only notable thing I did today is I initialized
repository and uploaded project files on git. I would really appreciate your help in solving this issue. It is really a constant headache not to be able to modify anything.

Answer Source

Just for the future reference, I solved this issue by explicitly defining request type to POST in $this->Form->create function.

It was one of the strangest error I came! Not sure why default PUT method was not working. It was converting to GET.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download