Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3345988
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:15:02+00:00 2026-05-18T01:15:02+00:00

I have the following php script which works flawlessly in normal circumstances (i.e. visiting

  • 0

I have the following php script which works flawlessly in normal circumstances (i.e. visiting the page directly):

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="css/contact_search.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.watermarkinput.js"></script>
<script type="text/javascript">
$(document).ready(function() {

$(document).click(function() {
    $("#display").hide();
});

var cache = {};

    $("#searchbox").keyup(function() {
        var searchbox = $(this).val();
        var dataString = 'searchword=' + searchbox;

        if (searchbox.length < 3 ) {
            $("#display").hide();
            } else {

            $.ajax({
                type: "POST",
                url: "contact_search/search.php",
                data: dataString,
                cache: false,
                success: function(html) {

                    $("#display").html(html).show();
                }
            });
        return false;
    });
});

jQuery(function($) {
    $("#searchbox").Watermark("Search for Group");
});
</script>
</head>

<body bgcolor="#e0e0e0">
<div class="body">


          <div class="liquid-round" style="width:100%;">
            <div class="top"><span><h2>Contacts List</h2></span></div>

            <div class="center-content"> 
                <img src="images/search.gif" style="float:right;" />
                <input type="text" id="searchbox" maxlength="20" value="<?php echo $_SESSION['hello'];?>" />
                <div id="display"></div><div style="clear:both;"></div>

            </div>

            <div class="bottom"><span></span></div>
        </div>


        <div class="liquid-round" style="width:97%;">
            <div class="top"><span><h2>My Messages</h2></span></div>

            <div class="center-content" style="min-height:200px;">                        
            </div>

            <div class="bottom"><span></span></div>
        </div>    


</div>
</body>
</html>

HOWEVER – when I add the following piece to the top of the page, the javascript/jquery functions simply stop working altogether.

<?php
    session_start();

    if( $_SERVER['SERVER_PORT'] == 80) {
        header('Location:https://'.$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"]); 
        die();
    }
?>

These pages require login so I need to ensure they are https protected but this error messes all that up. Any ideas what could be causing the issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:15:02+00:00Added an answer on May 18, 2026 at 1:15 am

    It’s probably the browser not displaying insecure (http) content on https pages, there’s a simple fix though, use a scheme relative URL, like this:

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
    

    This way you’ll get http://ajax.googleapis.com/.... on the http:// version of your page and https://ajax.googleapis.com/.... on the https:// version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following PHP code which works out the possible combinations from a
I have the following script which works with a 1 dimensional array. Is it
Hi I have the following script which works fine running on IIS but when
I have a php script which i would need the following 3 web browsers
I have the following PHP script: <?php $fortune = `fortune`; echo $fortune; ?> but
I have the following situation. I have a PHP script that imports a CSV
I have a PHP script that does the following: Uses file_get_contents() to get content
i have the following simple script <input class=input type=text name=password style=color: #797272; value= <?php
I have a directory structure like the following; script.php inc/include1.php inc/include2.php objects/object1.php objects/object2.php soap/soap.php
I have the following php code, which has been snipped for brevity. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.