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

  • SEARCH
  • Home
  • 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 3603764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:54:46+00:00 2026-05-18T20:54:46+00:00

Hey guys, I have this piece of code, and when I add return after

  • 0

Hey guys, I have this piece of code, and when I add return after echo(if there is an error and I need to continue right after the script) I can’t see the footer, do you know what the problem is?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" >
<head>
    <title>Login | JM Today </title>
    <link href="Mainstyles.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="container">
    <?php include("header.php"); ?>
    <?php include("navbar.php"); ?>
    <?php include("cleanquery.php") ?>  

    <div id="wrap">


       <?php
       ini_set('display_errors', 'On');
        error_reporting(E_ALL | E_STRICT);

        $conn=mysql_connect("localhost", "***", "***") or die(mysql_error());
        mysql_select_db('jmtdy', $conn) or die(mysql_error());

        if(isset($_POST['sublogin'])){

        if(( strlen($_POST['user']) >0) && (strlen($_POST['pass']) >0)) {

            checklogin($_POST['user'], $_POST['pass']);

        }
        elseif((isset($_POST['user']) && empty($_POST['user'])) || (isset($_POST['pass']) && empty($_POST['pass']))){

            echo '<p class="statusmsg">You didn\'t fill in the required fields.</p><br/><input type="button" value="Retry" onClick="location.href='."'login.php'\">";
            return;
        }
        }
        else{

            echo '<p class="statusmsg">You came here by mistake, didn\'t you?</p><br/><input type="button" value="Retry" onClick="location.href='."'login.php'\">";
            return;

        }   

      function checklogin($username, $password){

        $username=mysql_real_escape_string($username);
        $password=mysql_real_escape_string($password);

            $result=mysql_query("select * from users where username = '$username'");
            if($result != false){

                $dbArray=mysql_fetch_array($result);
                $dbArray['password']=mysql_real_escape_string($dbArray['password']);
                $dbArray['username']=mysql_real_escape_string($dbArray['username']);

                if(($dbArray['password'] != $password ) || ($dbArray['username'] != $username)){
                    echo '<p class="statusmsg">The username or password you entered is incorrect. Please try again.</p><br/><input type="button" value="Retry" onClick="location.href='."'login.php'\">";
                    return;
                }
                $_SESSION['username']=$username;
                $_SESSION['password']=$password;

                if(isset($_POST['remember'])){
                    setcookie("jmuser",$_SESSION['username'],time()+60*60*24*356);  
                    setcookie("jmpass",$_SESSION['username'],time()+60*60*24*356);
                }
            }

            else{
                echo'<p class="statusmsg">  The username or password you entered is incorrect. Please try again.</p><br/>input type="button" value="Retry" onClick="location.href='."'login.php'\">";
                return;
            }
        }           


      ?>
        </div>
        <br/>
        <br/>
<?php include("footer.php") ?>
</div>
</body>

</html>

Oh, and if the username and password is incorrect I could see the footer.

  • 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-18T20:54:46+00:00Added an answer on May 18, 2026 at 8:54 pm

    When you have a return statement and you are not inside a function, the script will exit, thus the parser never reaches the statement that imports the footer. Keep in mind your script is the entire document, not just the parts enclosed in tags. If the parser stops somewhere, the entire rest of the document is left out.

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

Sidebar

Related Questions

Hey guys I have a weird error I wrote this code against setbubblepopup $(document).ready(function
hey there guys and girls i have this code that saves json as a
Hey guys, I have this piece of jquery code: <script type=text/javascript > $(function() {
Hey guys, in this piece of code. Is there a way to redirect the
hey there guys and girls i have this code that should download a json
Hey guys, I have this quick bit of code that I can't figure out
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys have her an code where i add an option to a html
Hey guys. I have this function: i need split headers and html. string simpleGET(string
Hey guys, I have this code within a function inside a class that is

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.