1

I have a code from a client that runs on a local server. The index page shows background and forms but on the online server it only show background image and nothing else

Here is the index.php script:

<?php include('header.php'); ?>

  <body id="login">
    <div class="container">

      <form id="login_form" class="form-signin" method="post">
        <h3 class="form-signin-heading"><i class="icon-lock"></i> Please Login</h3>
        <input type="text" class="input-block-level" id="usernmae" name="username" placeholder="Username" required>
        <input type="password" class="input-block-level" id="password" name="password" placeholder="Password" required>
        <button name="login" class="btn btn-info" type="submit"><i class="icon-signin icon-"></i> Sign in</button>      
              </form>

<script>
            jQuery(document).ready(function(){
            jQuery("#login_form").submit(function(e){
                    e.preventDefault();
                    var formData = jQuery(this).serialize();
                    $.ajax({
                        type: "POST",
                        url: "login.php",
                        data: formData,
                        success: function(html){
                        if(html=='true')
                        {
                        $.jGrowl("Welcome to Thutoboswa Learning Management System", { header: 'Access Granted 😀 #WearAMask😷' });
                        var delay = 2500;
                            setTimeout(function(){ window.location = 'dashboard.php'  }, delay);  
                        }
                        else
                        {
                        $.jGrowl("Please Check your username and Password", { header: 'Login Failed' });
                        }
                        }                       
                    });
                    return false;
                });
            });
            </script>
    </div>    
    
    <!-- /container -->
<?php include('script.php'); ?>
</body>
</html>
  

Mozila Firefox console shows these warnings:

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”. gobojangojss.co.bw

Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# insteadjquery-1.9.1.min.js:2:21

Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content. modernizr-2.6.2-respond-1.1.0.min.js:4:3946

downloadable font: bad search range (font-family: "TR Century Gothic" style:normal weight:400 stretch:100 src index:0) source: https://gobojangojss.co.bw/admin/bootstrap/css/TR%20Century%20Gothic.ttf

downloadable font: bad range shift (font-family: "TR Century Gothic" style:normal weight:400 stretch:100 src index:0) source: https://gobojangojss.co.bw/admin/bootstrap/css/TR%20Century%20Gothic.ttf

downloadable font: cmap: bad id_range_offset (font-family: "TR Century Gothic" style:normal weight:400 stretch:100 src index:0) source: https://gobojangojss.co.bw/admin/bootstrap/css/TR%20Century%20Gothic.ttf

Source map error: Error: request failed with status 404
Resource URL: https://gobojangojss.co.bw/admin/vendors/jquery-1.9.1.min.js
Source Map URL: jquery.min.map
4
  • There's no PHP code here except the two include() calls. Commented Sep 8, 2021 at 16:00
  • Check the server error log. Commented Sep 8, 2021 at 16:00
  • Open up your browser's developer console and reload the page. Check for any errors, such as missing files, in the Console and the Network tab. Commented Sep 8, 2021 at 16:11
  • No errors on server or on console Commented Sep 8, 2021 at 16:42

1 Answer 1

1

Goood day, Ace.
Check please if you uploaded 2 files to server:

  • header.php
  • script.php

Another solution is to open Chrome Console. Press F12
And in NAME column you will see the PHP file that work with you Ajax query. enter image description here

Click on this php file and see what POST parameters come back from server to you.
enter image description here

update

this string tell us that yourcode missing jquery.

Resource URL: https://gobojangojss.co.bw/admin/vendors/jquery-1.9.1.min.js

Can you add this to functions,php file

wp_enqueue_script('jquery');
Sign up to request clarification or add additional context in comments.

3 Comments

the files: -header.php -script.php are uploaded on the server. Trying to follow the rest of your instructions.
Deal, Ace. If you need any help with PHP files, let me know please
I have updated the question. Chrome did not show any warnings but Firefox did. I added them to the question.

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.