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 8929573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:42:07+00:00 2026-06-15T08:42:07+00:00

I am working on a site for class, and i have a form system.

  • 0

I am working on a site for class, and i have a form system. My friend is working on the design, and therefore the index site is actually just this:

<!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=iso-8859-1" />
<title>Nail n' Bolts man</title>
<link href="../../styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="../../js/main.js"></script>
</head>

<body>

    <div id="main">
        <center>
            <div id="header">
                Nails & Bolts APS - Admin side
                <img src="../images/header.jpg" alt="header" width="" height="" />
            </div>

            <?php require('php/newEmployee.php'); ?>
        </center>
    </div>

</body>
</html>

Then in newEmployee.php i also require another file called varibleEcho.php Basically this file just has a function with a switch case statement, echoing different code depending on what you call from newEmployee.php

however for some reason, when i check the source of the site with google chrome, it seems that the echoing cleans everything of except the stuff i echo. This means my metadata css jquery and such dissapers.

Any ideas on why it has this behaviour?

Edit:

Here is the entire site (indes.php up there):

newEmployee.php

<?php
require('php/variableEcho.php');
    if(!isset($_POST['rank']) || !isset($_POST['fname']) || !isset($_POST['lname']) || !isset($_POST['initials']))
    {
        variableEcho(0);
        variableEcho(1);    
    }
    else if($_POST['rank'] == '' || $_POST['fname'] == '' || $_POST['lname'] == '' || $_POST['initials'] == '')
    {
        variableEcho(0);
        variableEcho(3);
        variableEcho(1);
    }
        else if($_POST['password'] != '')
    {
    echo $_POST['password'];
    $hasLetter = false;
    $hasNumber = false;
    $hasLength = false;

    $pwd = $_POST['password'];

    $strlen = strlen($pwd);
    $pwdarr = str_split($pwd);

    $ints = 0;
    $chars = 0;
    foreach($pwdarr as $x)
    {
        if(is_int($x))
        {
            $ints++;
        }
        if(ctype_alpha($x))
        {
            $chars++;
        }
    }
    if($ints >= $strlen || $chars >= $strlen)
    {
        variableEcho(0);
        variableEcho(4);
        variableEcho(1);
    }

    if($strlen >= 8)
    {
        variableEcho(0);
        variableEcho(4);
        variableEcho(1);
    }
}
?>

variableEcho

<?php
function variableEcho($echoSelect)
{
    switch($echoSelect)
    {
        case 0:
            echo('
                <form action="" method="post">
                    <table>
            ');
            break;

        case 1:
            echo('
                        <tr>
                            <td><label for="fname">First name*</label></td>
                            <td><input type="text" name="fname" id="fname"/></td>
                        </tr>
                        <tr>
                            <td><label for="lname">Last name*</label></td>
                            <td><input type="text" name="lname" id="lname"/></td>
                        </tr>
                        <tr>
                            <td><label for="rank">Rank*</label></td>
                            <td><input type="text" name="rank" id="rank"/></td>
                        </tr>
                        <tr>
                            <td><label for="initials">Initials (3 length)*</label></td>
                            <td><input type="text" name="initials" id="initials"/></td>
                        </tr>
                        <tr>
                            <td><label for="password">Password</label></td>
                            <td><input type="text" name="password" id="password"/></td>
                        </tr>
                        <tr>
                        <td><input type="submit"/></td>
                    </form>
            ');
            break;

        case 2:
            echo('
                        <tr>
                            <td><div class="errText">A password is required for admins.</div></td>
                            <td></td>
                        </tr>
            ');
            break;

        case 3:
            echo('
                        <tr>
                            <td><div class="errText">Please fill out all the obligatory fields.</div></td>
                            <td></td>
                        </tr>
            ');

        case 4:
            echo('
                        <tr>
                            <td><div class="errText">The password need to be of atleas one letter, one number, and 8 long.</div></td>
                            <td></td>
                        </tr>

            ');
            break;

        default:
            echo('
                biscuit
            ');
            break;
    }
}

?>
  • 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-06-15T08:42:08+00:00Added an answer on June 15, 2026 at 8:42 am

    I figured out my issue, and it was sadly a simple one 😛

    require ‘newEmployee.php’;

    would include that php file. In that file i required another one, where the filepath were relative to newEmployee.php locaiton. I now instead include both variableEcho, and newEmployee from the main file.

    <?php
        require('../../php/variableEcho.php');
        require('../../php/newEmployee.php');               
    ?>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on an oophp application. I have a site class which will
My form validation is working nearly complete, I just have 2 cases I don't
Hello my smart friends i have this contact form that i am working on.
I have to make some mods to an existing (and working) magento site. So
I am working on smartphone site. Is there a way to set Bookmark this
I'm working on a site design and I'm using Google Fonts, the Raleway one
I'm working on an email series signup form that needs to have a checkbox
So I have had various forms of this working in the last while, but
I have a base class DockedToolWindow : Form, and many classes that derive from
I'm working on a tooltip for my site's contact form (can be seen here

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.