I'm new to web programming. I've created a simple login form (with php). Now I want to turn this one into a HTTPS (with SSL) login form. What should I do to achieve this?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Get an SSL certificate. Once you have HTTPS working on your server (work with your hosting company to get it working), you can use code similar to the following to force an HTTPS connection in PHP. .htaccess is another option, mentioned elsewhere.
You will need to enable SSL, if it is not already enabled If you are going to run this in production, you will also need to purchase and install an SSL cert instead of a self-signed cert.
If SSL is enabled, then running your form with https instead of http as the comment above says will work
To force users to use the SSL version add something like the following to your .htaccess file