Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: I need help, 2 questions. :)

  1. #1
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need help, 2 questions. :)

    Hey, im new to php n relativly new to scripting but i was wondering if there's a working code (ima show what i want to do) for this..

    Code:
    Number 1.
    
              <?php $style1
                       $style2
                       $browser = getenv("HTTP_USER_AGENT");
    
                       if $browser = mozilla;
                       <link href="style.css" rel="stylesheet" type="text/css" />;
                       else
                       <link href="style2.css" rel="stylesheet" type="text/css" />;
    ?>
    Well as you might notice, im trying to use a different stylesheet depending on if its FF or IE (IE = else)

    Number 2
    id like to make the middle of my page into a "frameish thing"(<div id="index"> but not a frame. jus need the menu and banner/logo to NOT reload for the visitors.. would be cool. you can see how the site looks atm http://underground.ninetwozero.com <--- my "beta" site.

    peace - Kalle

    edit: the site looks f*cked up in IE?! :S
    Last edited by NineTwoZero; 01-06-2007 at 01:12 PM. Reason: noticed something

  2. #2
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The site looked ok in IE, but it does have a blue border around the nav links. You can fix that simply by adding border="0" into your image link.
    Change this:
    HTML Code:
    <img src="img/banner3.png" alt="banner" />
    To this:
    HTML Code:
    <img src="img/banner3.png" alt="banner" border="0" />
    That should take out the blue borders. As for your question about switching css sheets depending on browser, I am unsure how that can be done, but I believe it can. Hopefully someone will know and post it

  3. #3
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you very much IE seems to have problems with a:img in css

    any1 got solution for nr1 or nr2?

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Well for number 1, it would be easier to use Javascript for this. The code you posted abouve would parse errors with every line. I currently don't have the time to explain what's wrong with it, but maybe someone else could. I recommend taking a look at the following two scripts here on dynamic drive maybe even merging them together.

    http://www.dynamicdrive.com/dynamicindex9/dyncss.htm
    http://www.dynamicdrive.com/dynamicindex9/bredirect.htm

    Hope this helps for now.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    aiiit ill check them out the first error in my script was on line 3 xP but I jus wrote it to give you guys an idea of what i wanna acomplish.

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Well, when using server side scripting to get the browser agent, it prints out the entire information about it. Try the following code to see what I mean (be sure to view them in different browsers as well).

    Code:
    <?php
    <?php
       
    $browser = getenv("HTTP_USER_AGENT");
    
       echo $browser;
    ?>
    It would be hard to determine which stylesheet to use by doing this, that is why I recommend using Javascript.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #7
    Join Date
    Jan 2007
    Location
    Sweden
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    i'll try to combine the two scripts you linked me to.

    thank you

  8. #8
    Join Date
    Aug 2006
    Location
    Ohio
    Posts
    266
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Glad my little knowledge could help out . I was looking at your CSS and noticed that you didn't have float: left; on many of your divs. When I code with CSS, I have a float: left on every div tag unless i set it to float: right. I am not sure if this is the problem with the way IE is displaying it, but its worth a shot

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    There is an extra <?php in thetestingsite's php code. Remove that.

    Also, there is another thread about this.... not sure why it's here twice. Please only post one thread. We'll be happy to answer it and help, but no need to do so twice.

    http://www.dynamicdrive.com/forums/s...ad.php?t=16290
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  10. #10
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Oh wow, I completely missed that. Thanks, djr33. I guess that's what happens when you are working, talking to customers troubleshooting their problems, then typing up code on here. Anyway, thanks.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •