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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:51:24+00:00 2026-05-31T16:51:24+00:00

i have a dynamic php web page localhost/ctd/index.php All working good except if i

  • 0

i have a dynamic php web page

localhost/ctd/index.php

All working good except if i add a forward slash to it like below:

localhost/ctd/index.php/

the css doesnt load..

is this a css bug or PHP?

The full code of index.php

<?php
define('pageaccess', TRUE); 
$action = $_GET['p'];
include "views/header.php";
if($action=='student')
{
    include "views/student.php";
}else if($action=='college'){       
    include "views/college.php";
}else if($action==''){      
    include "views/home.php";
}else{
    include "views/404.php";
}   
include "views/footer.php";
?>

CSS link

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

Point me to the right direction.

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-31T16:51:25+00:00Added an answer on May 31, 2026 at 4:51 pm

    The problem is that your link is relative.

    For example, if you have link like this:

    <link rel="stylesheet" href="css.css">
    

    And you’re currently at http://localhost/example.php/ then it loads http://localhost/example.php/css.css. It’s server-specific thing, some servers implement this “feature”, some not. The browser thinks it’s directory, while in fact it isn’t. Some PHP scripts use this behavior, for example MediaWiki uses index.php as directory to emulate .htaccess when server doesn’t support .htaccess files, but supports CGI scripts as directories.

    The solution would be either making sure that every path uses page root instead of current directory (for example /css.css instead of css.css).

    Second solution would be sort of hacky, but would convert links. Don’t use if you actually want to use this sort of links (but I doubt this :P).

    <?php
    $request_uri = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
    if ($request_uri !== $_SERVER['SCRIPT_NAME']) {
        header('Location: ' . $_SERVER['SCRIPT_NAME']);
        exit;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have dynamic web page with JS. There is a <textarea> and a Send
I have a dynamic php page which I need to call with a get
I have a dynamic web page and want to implement dynamic guestbook into DIV
I have been asked to look into dynamic web page development, and there appears
I have a web page and using php Im quering a database and displaying
I have created a dynamic list picker script using Jquery 1.3 and PHP that
I have some PHP code that generates dynamic tables of data on the fly.
I have a Dynamic Data Entities Web Application that uses a database with GUIDs
I am writing a dynamic web page. The specific problem I am having is
So, I'm new to dynamic web design (my sites have been mostly static with

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.