2

When I try to submit a form from Https to http it shows:

Form Insecure are you sure you want to submit?

when I submit the page, it starts loading and it hangs forever. This form submitting works on android PC and safari mac.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Mehdi Ammar
  • 61
  • 1
  • 9
  • this is a simple fix. If you have any instances of `http://`, change them all to simply `//`. This for href's, images, scripts, etc. – Funk Forty Niner Oct 19 '18 at 14:55
  • your method worked but it redirected to https:// instead of http:// and it gave me page not found im using code igniter – Mehdi Ammar Oct 19 '18 at 15:06
  • *"When i try to submit a form from Https to https"* - I don't get this (edit: ok, you edited). Now you say it redirects to https. You're going to have to check if you have a header/redirect somewhere or in `.htaccess`. The question is unclear in regards to that. If you want to redirect to http, use a header or other form of redirection to be http instead. – Funk Forty Niner Oct 19 '18 at 15:07
  • Just do a redirection, see what I posted in the answer below. If that still doesn't work, you will need to post your code and other relevant information that I/others can use and hopefully provide you with a complete solution. I have to note that I may not be able to help you with CodeIgniter since I haven't worked with it enough and I do not work with that framework. – Funk Forty Niner Oct 19 '18 at 15:21

1 Answers1

0

As I said in comments, change all instances of http:// to // for scripts, images, etc. they will automatically detect either protocol for the environment it's in.

If as you say it redirects to an https protocol rather than what you would like it to redirect to http, you can simply use a header or other form of redirection.

Examples:

header("Location: http://example.com/other_page.php");
exit; // This stops further execution

or a meta method:

<meta http-equiv="refresh" content="0;url=finalpage.html">

or Javacript:

window.location.replace("http://example.com/");

The above examples were pulled/borrowed from:

How to make a redirect in PHP?

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141