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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:38:19+00:00 2026-05-30T15:38:19+00:00

I got file index.php that includes index.php file in admin folder <?php require ‘admin/index.php’;

  • 0

I got file index.php that includes index.php file in admin folder

<?php require 'admin/index.php'; ?>

in admin folder index.php file is basically login form that imports 2 css files

<DOCTYPE HTML>
<html>
    <head>
        <title>Simple Login Form</title>
        <meta charset="UTF-8" />
        <meta name="Designer" content="PremiumPixels.com">
        <meta name="Author" content="$hekh@r d-Ziner, CSSJUNTION.com">

        <-- site layout -->
        <link rel="stylesheet" type="text/css" href="css/reset.css" />
        <link rel="stylesheet" type="text/css" href="css/structure.css" />

    </head>

    <body>

        <form id="myForm" class="boxlogin" action="index.php" method="POST">
            <fieldset class="boxBody">
                <label>Email <span style="color:red;"><?php if(isset($errorMsg)) echo $errorMsg;?></span></label>
                <input name="email" type="text" tabindex="1" placeholder="root" required>
                <label><a href="" class="rLink" tabindex="5">Forget your password?</a>Password</label>
                <input name="password" type="password" tabindex="2" required>
            </fieldset>
            <div class="footer">
                <label><input type="checkbox" tabindex="3">Keep me logged in</label>
                <input type="submit" class="btnLogin" value="Login" tabindex="4"/>
            </div>
        </form>

    </body>
</html>

When I run index.php file, script includes admin/index.php file.
But links to css are broken because admin/index.php file was included
in file with different path.

I could change .css files path to

<link rel="stylesheet" type="text/css" href="admin/css/reset.css" />
<link rel="stylesheet" type="text/css" href="admin/css/structure.css" />

and that would fix the problem, but what if I want to call /admin/index.php script from another path.

Let’s assume that “root folder” is not in root folder on sever, for example /var/www/php/loginscript/

What is the best solution for this situation?
Thanks.

  • 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-30T15:38:20+00:00Added an answer on May 30, 2026 at 3:38 pm

    Do this:

    <link rel="stylesheet" type="text/css" href="/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/css/structure.css" />
    

    Note the added / in hrefs

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

Sidebar

Related Questions

Edit : I've got an aspx file (default.aspx) that loads a flash file (index.swf),
I am editing an index.php file in the themes folder and I just need
I got a problem about including a included file in PHP. Project functions(folder) has
I've got a PHP script that includes ( or 'requires' ) a set of
I've got a file (possibly binary) that contains mostly non-printable ASCII characters as the
I just got a strange problem. I am including some files from my index.php,
I wan't to redirect everything to index.php exepept if a file or directory exists.
So, we've got PHP 5.3.2 installed on a Windows 2008 R2 Server. PHP.ini file
I have two file one is index.php another one is dbsubmit.php In my index.php
I have this ajax_update script that updates file.php every 60 seconds.. Now file.php outputs

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.