Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Senior Member ULTiMATE's Avatar
    Join Date
    Nov 2002
    Location
    England
    Posts
    124
    Member #
    308
    if you take a look at this site, they have some special dropdown which allows people to change the layout they are using on their site, how would you go about doing it in this way

    http://www.dbgtn.com

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    There are many ways to do it. The one that doesn't integrate with anything is to set a cookie and then in various parts of the page, test what the cookie is and output HTML accordingly.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member ULTiMATE's Avatar
    Join Date
    Nov 2002
    Location
    England
    Posts
    124
    Member #
    308
    i can do something very basic, but i want the page to always be on index.php, what would i have to do to do that

  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    What do you mean?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member ULTiMATE's Avatar
    Join Date
    Nov 2002
    Location
    England
    Posts
    124
    Member #
    308
    if you look at dbgtn's change layout dropdown, when you change the layout, the page always shows index.php?... so how would i get it to work this way for changing my layout, but having it always stay on that

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I still don't get what you're saying...unless you mean not cooking you in which case you'd just check the contents of $_GET['somevar'] instead of a cookie.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Senior Member ULTiMATE's Avatar
    Join Date
    Nov 2002
    Location
    England
    Posts
    124
    Member #
    308
    well how would i do it with a cookie, so that i know what possibilities i would have for doing it

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Senior Member nsr81's Avatar
    Join Date
    Oct 2002
    Posts
    1,132
    Member #
    250
    Liked
    15 times
    Here's an example that might help.

    Assuming that you have each layout in layoutX.html file (X being being the version number). i.e. layout1.html, layout2.html.

    Here is what you'd do in your index.php
    PHP Code:
    <?php
    $layout_number 
    $_COOKIE["layoutnum"];
    if(!isset(
    $layout_number) || $layout_number == "")
    {
       
    $layoutout_number 3;  //assuming 3 is the latest one.
    }

    $layout_file "layout$layout_number.html";
    include(
    $layout_file);
    ?>
    To set a cookie, use a file named something like setCookie.php, and call it as setCookie.php?id=X (X being the layout number. I assume you know how to do that using jump menu (drop down menu).
    PHP Code:
    <?php
    if(isset($id))
    {
      
    setcookie ("layoutnum"$id,time()+86400"/");
    }

    header("Location: index.php");
    exit;
    ?>
    There and Back Again :Ogre:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:56 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com