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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:14:00+00:00 2026-06-07T10:14:00+00:00

My idea is to switch multiple links to CSS files, if special URL was

  • 0

My idea is to switch multiple links to CSS files, if special URL was detected. But I have a trouble: my code includes only css in the first if..else statement. And it doesn’t depend on the URL.

Here is my code.
http://pastebin.com/Jm3QFDmH

ported from pastebin

<?php
// get first folder in URL
$f_folder = substr(substr($_SERVER["REQUEST_URI"],1), 0, strpos(substr($_SERVER["REQUEST_URI"],1), "/"));
//get full directory structure from URL for current page
$full_path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
//css for account
if ($f_folder='account') {
?>
    <link rel="stylesheet" href="/mainstyle/common.css" type="text/css" charset="utf-8" />
    <link rel="stylesheet" href="/mainstyle/account.css" type="text/css" charset="utf-8" />
<?php 
} elseif ($f_folder='signin'||$f_folder='signup'||$full_path='/account/resetPassword'||$full_path='/account/logout') {
?>
    <link rel="stylesheet" href="/mainstyle/login-signup.css" type="text/css" charset="utf-8" />
<?php
} else {
?>
    <link rel="stylesheet" href="/mainstyle/common.css" type="text/css" charset="utf-8" />
<?php
}
?>

Where is mistake?

  • 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-07T10:14:01+00:00Added an answer on June 7, 2026 at 10:14 am

    if and elseif, should have == comparison operator , not = assignment

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

Sidebar

Related Questions

My idea was to switch between some colors, so I don't have to use
I am a netbeans user, now I want to switch to Intellij IDEA. But
I have seen it written in multiple threads/comments on stackoverflow that using switch is
I may have the wrong idea with this but bear with me... I have
I have a coworker who is looking to switch from InteilliJ Idea to Eclipse,
Idea: I want to make smth like real time electronic blackboard. Many users have
I want to switch between 3 pictures fading in and out between them but
I am going to have multiple types of an object and I am really
Here is i wish to do. I want to have multiple webview loading their
I have done a couple of simple swing based apps with static layout, but

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.