mevdschee / php-crud-ui

Single file PHP script that adds a UI to a PHP-CRUD-API project
MIT License
123 stars 55 forks source link

PUT/UPDATE not working on Webserver, but working on the localhost #19

Closed anushaath closed 7 years ago

anushaath commented 7 years ago

Hi I tested 'ui.php' and 'api.php' on localhost (XAMPP). Its working fine. Now I uploaded it on an actual web server. I tested the API with postman for the web, and its working perfectly. But when I load the 'ui.php' file, the screen is blank. Nothing is displayed. I double checked if the problem was with Sessions, which I was using, but that is also working fine. I'm not able to locate the where the problem seems to be occurring. Any ideas?

anushaath commented 7 years ago

Is it ok if the server is running on PHP version 5.4 or 5.6? I see that the minimum requirement is v5.3

anushaath commented 7 years ago

I got it working.

The edit and delete function are not working as expected. They dont update anything in the db nor delete anything from the db

anushaath commented 7 years ago

I've changed the .htaccess file also to allow PUT and DELETE request. But still not able to make it work. Postman displays a 404 error.

anushaath commented 7 years ago

I think my error is similar to this #93 But, I dont know how to define that verb. Mine is hosted on GoDaddy.

anushaath commented 7 years ago

Dont really require the DELETE part in my project.

UPDATE: I changed the permissions on the .htaccess file to give access to PUT request. Now PUT request is working on Postman, while testing the API. And yet, if I edit a record on the ui.php, it does not reflect on the database.

mevdschee commented 7 years ago

I plan to look into this tonight

mevdschee commented 7 years ago

I can't reproduce this issue. Can you provide more details?

anushaath commented 7 years ago

It seems to be working as of now. I think the problem was with the host as it was not allowing the PUT request for security reasons.