I've programmed a little php
Script, which just uploads a file from a user to the server.
I've tested in on my XAMMP
Server locally, and everything worked fine.
But when i uploaded it to my GitHub Pages
Here, It got this error 405 NOT ALLOWED
So i googled a lot and found out that i have to allow the HTTP Post
Method.
My Question is now:
How do i allow POST
method on my github page?
Thank you in advance.
GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website. You can see examples of GitHub Pages sites in the GitHub Pages examples collection.
The GitHub Pages API allows you to interact with GitHub Pages sites and build information.
Github pages will not execute any serverside code. You may only upload static files (html,css,js, images, etc.). In order to have a hosted backend you should look for another service like Google Cloud, AWS Lambda, Heroku, etc.
GitHub pages can only serve static content, and there is no way to run PHP on GitHub pages or upload things. That's why GitHub doesn't allow POST requests.
If you need server side scripting (E.g. PHP), you'll need to use a web host which offers these things.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With