php adding SSL certificate

I have a problem.

My website is running an SSL on the checkout page. This is the current message I get.

Read More

The page at ‘https://jonathanmichael.co.uk/checkout/‘ was loaded over
HTTPS, but is submitting data to an insecure location at
http://jonathanmichael.co.uk/‘: this content should also be submitted
over HTTPS.

<form action="http://jonathanmichael.co.uk/" method="get" id="adminbarsearch"><input class="adminbar-input" name="s" id="adminbar-search" type="text" value="" maxlength="150"><input type="submit" class="adminbar-button" value="Search"></form>

My question is how do I fix this? I’m using WordPress, I have found this code which I think links to it.

searchform.php

<!-- Start SearchForm -->
<form method="get" class="searchform" role="search" action="<?php echo home_url(); ?>/">
    <fieldset>
        <input name="s" type="text" id="s" placeholder="<?php _e( 'Search', THB_THEME_NAME ); ?>" class="small-12">
    </fieldset>
</form>
<!-- End SearchForm -->

I have zero knowledge of PHP for help would be appreciated.

Thanks!

Related posts

Leave a Reply

2 comments

  1. Easy. Just explicitly change the form action to:

    <form action="https://jonathanmichael.co.uk/checkout/"
    

    Also, please use $_POST for your form.
    $_GET should not be used for anything that is supposed to be secure.

    <form action="https://jonathanmichael.co.uk/checkout/" method="POST" id="adminbarsearch">
    
  2. You need to pass the $scheme parameter to the call to home_url()

    This will let you generate the link with the https:\ prefix.

    See the documentation: http://codex.wordpress.org/Function_Reference/home_url

    <!-- Start SearchForm -->
    <form method="get" class="searchform" role="search" action="<?php echo home_url($scheme = https); ?>/">
        <fieldset>
            <input name="s" type="text" id="s" placeholder="<?php _e( 'Search', THB_THEME_NAME ); ?>" class="small-12">
        </fieldset>
    </form>
    <!-- End SearchForm -->