0

Good Day

I have a normal PHP page doing some functions I am trying to use GEOLOCATION from the pages to obtain the handset location.

I am getting error now stating **Error: Only secure origins are allowed (see: **

Is there a way I can change the PHP page to use HTTPS or do I require to buy a SSL Certificate for the site? I have never worked with HTTPS before and not sure how to direct the page to become HTTPS or how to alter the page for this.

What would be the best method for this.

1
  • 2
    The HTTPS layer is handled by the webserver (e.g. apache or nginx), so, buy your self a certificate (if you're hosting on AWS you might be able to get one for free) and enable HTTPS on your webserver, see that everything is broken oven https and reevaluate life choices. Commented Oct 17, 2016 at 8:34

1 Answer 1

1

Php has nothing to do with HTTPS. Your server needs to provide SSL certificates that you can buy or find somewhere.

If you already have those you can then use php, or javascript or whatever to force the user to use HTTPS doing maybe a redirect or something similar.

Sign up to request clarification or add additional context in comments.

2 Comments

So if I understand correctly once I have the SSL Cert it will not require much coding to use the SSL. The SSL is basically between client and my page then I should not have much errors? Sorry I am very new to SSL Certificates well this is my first time to use it
@JamesWright Yes exactly. you won't have to code anything for SSL to work. It is something that the server is responsible for, not the php code. Browsers and Server will do the work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.