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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:58:36+00:00 2026-06-06T00:58:36+00:00

Firstly sorry if this is a common question but I couldn’t find anything on

  • 0

Firstly sorry if this is a common question but I couldn’t find anything on Google and it doesn’t seem overly documented.

I’m currently making a portfolio for myself showcasing my graphic design and things. I love how it looks but I do realise it looks quite dark in comparison to other websites. The text in the navigation bar especially is also quite small, but I don’t want to change it.

Instead I would like to have a small iOS style switch at the bottom of the page which when clicked would take the user to an alternate version of the page in question, or just a version with different CSS applied to it. I could then set the backgrounds lighter, the text bigger, etc. The simple but tedious solution would be to make each page four times, one with big fonts and light backgrounds, one dark and small, etc. but this isn’t ideal. I was wondering if I could make something more like:

portfolio.co.uk/home?light=on&text=big

As far as I know dynamic URLs (as I believe they’re called) are a PHP thing but I have as little experience with PHP as a man without experience of PHP. I was wondering if this task would be possible without getting too complex and if maybe there’d be a way of even creating a cookie so that a recurring visitor wouldn’t have to navigate to their preferred version every time.

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-06-06T00:58:39+00:00Added an answer on June 6, 2026 at 12:58 am

    Use the query string parameters to determine which stylesheet to load.

    Basically, create a general stylesheet that is always loaded, regardless of which theme you are using. Then, put theme-specific rules into separate stylesheets and use PHP if statements to determine what markup to send to load the appropriate page.

    <head>
        <link href="common.css" rel="stylesheet" type="text/css" />
        <link href="<?php echo $_GET["style"] == "iPhone" ? "iPhone" : "normal" ?>.css" rel="stylesheet" type="text/css" />
       ...
    </head>
    

    Note, I use the if-check (the ternary operator ? :) rather than just use the string directly from the query string because I want to have a way of sending a default if the user changes the query string and makes a mistake. If you have multiple themes you want to use, you can set up a switch statement and store the appropriate filename in a variable that you reference in the link tag.

    $stylesheet = "default";
    switch ($_GET["style"]) {
        case "iPhone": $stylesheet = "iPhone";
        case "bigBold": $stylesheet = "bigBold";
    }
    
    <link href="<?php echo $stylesheet; ?>.css" rel="stylesheet" type="text/css" />
    

    How to Use:

    To add this code into your PHP page, place the switch code at the top of the page (or, better yet, in it’s own included file.

    Top of the page

    Set up your page like this:

    <?php 
        $stylesheet = "default";
        switch ($_GET["style"]) {
            case "iPhone": $stylesheet = "iPhone";
            case "bigBold": $stylesheet = "bigBold";
        }
    ?>
    <!DOCTYPE html>
    <html>
        <head>
            <link href="common.css" rel="stylesheet" type="text/css" />
            <link href="<?php echo $stylesheet; ?>.css" rel="stylesheet" type="text/css" />
           ...
        </head>
        <body>
            ...
        </body>
    <html>
    

    This code would need to be added to every page where you wanted to use alternate styles, so the better option is to separate this code into a file that can be included on all pages.

    As an included file

    Create a file named stylesheetSelector.php and add this code to it:

    <?php 
        $stylesheet = "default";
        switch ($_GET["style"]) {
            case "iPhone": $stylesheet = "iPhone";
            case "bigBold": $stylesheet = "bigBold";
        }
    ?>
    

    Then, in your PHP page:

    <?php include_once('stylesheetSelector.php'); ?>
    <!DOCTYPE html>
    <html>
        <head>
            <link href="common.css" rel="stylesheet" type="text/css" />
            <link href="<?php echo $stylesheet; ?>.css" rel="stylesheet" type="text/css" />
           ...
        </head>
        <body>
            ...
        </body>
    <html>
    

    Do this on all pages, then, if you ever decide to add additional themes, you can simply add the information to the stylesheetSelector.php file and it will be available on EVERY page that includes it.

    CAVEAT: This needs to be done in a .php file, or your web server needs to use PHP to handle .html files, otherwise you’ll see the PHP code in cleartext (it won’t be interpreted).

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

Sidebar

Related Questions

Firstly I asked sorry if this is a stupid question. but I have a
Firstly, sorry about the long question... but this is doing my head in. Any
Sorry if the title is misleading, but I really couldn't think of anything better.
Firstly, please don't dismiss this question - I'm aware it's an ugly situation but
Firstly, Sorry For lengthy question but I have to give some underlying information. We
Firstly sorry for the long piece of code pasted below. This is my first
Firstly, sorry for my English (I'm from China). By reading this article( how to
Firstly, I do not have any malicious intent out of this question. I would
Firstly, sorry about the question title, it may not be very descriptive for my
This is probably a noob question that I will get slated for but 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.