SEO Software
+ Reply to Thread
Results 1 to 9 of 9

Thread: how can I change CSS link using external php

  1. #1

    Default how can I change CSS link using external php

    Hello,

    any one can please tell me how can i change CSS link using external php
    basically I am trying to change the link to my style sheet in the head of my index, by using an external php page with dropdown menu. Let's say someone selects "Style 3 - Green" from the dropdown and it automatically changes the link in the index to "style_green.css", is this possible, without using databases? I am trying to allow the user to select various css files without manually changing links in the index.

    Thanks in advance.


  2. SEO Software

  3. #2
    Registered User Tom12 is on a distinguished road Tom12's Avatar
    Join Date
    Nov 2009
    Location
    The Hague,Netherlands
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Well, I guess you should meet a good programmer or you can take suggestions from the senior webmaster from this forum.

  4. #3

    Default

    Quote Originally Posted by Tom12 View Post
    Well, I guess you should meet a good programmer or you can take suggestions from the senior webmaster from this forum.
    Thanks for suggestion, i'll try for good programmer.

  5. #4

    Default

    Well, I guess you should meet a good programmer or you can take suggestions from the senior webmaster from this forum.
    hope so .

  6. #5
    Fresh Meat Zoli is on a distinguished road Zoli's Avatar
    Join Date
    Jan 2009
    Location
    Veszpr?m, Hungary
    Posts
    29
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default

    You need to link to a default css file when the page is rendered first time. You may offer the multiple design for your visitors via form or usual links. Depending on the realization javascript or a php script will put a cookie with the id of the preferred css to the client's computer, and refresh the page. The original index page will check if the cookie value identify a valid css and print the output according to the visitor preference. This is the basic logic.

  7. #6

    Default

    Well, I estimate you should meet a beneficial programmer or you can consider suggestions from the elder webmaster from this forum.hints

  8. #7

    Default

    To include css in php you can use html tag

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

  9. #8
    Fresh Meat kidzrback is on a distinguished road kidzrback's Avatar
    Join Date
    Oct 2010
    Location
    Hamilton Ontario Canada
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    <?php
    $selection = (int)$_GET['selection'];
    if( $selection == 0 ) echo "<link href='default.css' type='text/css'>";
    if( $selection == 1 ) echo "<link href='1style.css' type='text/css'>";
    if( $selection == 2 ) echo "<link href='2style.css' type='text/css'>";
    ?>
    If you know how to make the drop down, just set the value 'selection' as 1,2 or more values. IF no value is selected, it will use the default.css. This is a very simplistic example.

  10. #9

    Default

    Changing CSS link using external php is little bit difficult and lengthy process. I suggest you to use javascript. This is more easy and short time process.

    ATVs For Sale - Used cars

+ Reply to Thread

Similar Threads

  1. WD external hard drive
    By rebecca16 in forum Advertisements
    Replies: 2
    Last Post: 11-24-2009, 05:19 AM
  2. Replies: 2
    Last Post: 10-28-2009, 08:53 AM
  3. inner links more valuable then external?
    By bwfield in forum Link Development
    Replies: 0
    Last Post: 06-10-2008, 10:07 AM
  4. External Hard Drive
    By TropormLill in forum General Discussion
    Replies: 6
    Last Post: 05-29-2008, 09:52 PM
  5. what are the advantages of using external CSS
    By techabhi in forum Design and Development
    Replies: 11
    Last Post: 05-27-2008, 04:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts