Those upgrades will always get you. I just upgraded to the latest PHP source and now am running into a CSS problem with phpInfo().

I'm trying to find out if there is any way to turn off the embedded styles in the results from phpInfo()?

I couldn't find a solution anywhere so here I am. Some things I've tried:
- try to contain the phpInfo() contents into a div tag.
- try to import my pages style sheet after the phpInfo()
- iframes isn't an option for me 🙁

My feeling is that there is a defined style in the phpInfo() stuff that I didn't define in my styles. Consequently, that is effecting my page. I will start looking for the specific style but I think this would be an even more useful function if I could tell phpInfo to not use it's styles???

Appreciate any help.
~jerry

    I didnt actually think it used CSS

    IM pretty sure it builds itself from the php.ini file.

      i thought it was just a lot of variable functions eg
      $SERVER[''], COOKIE[*] etc

        Nope, it's definately adding a style sheet... here is what gets added by default:
        <style type="text/css"><!--
        body {background-color: #ffffff; color: #000000;}
        body, td, th, h1, h2 {font-family: sans-serif;}
        pre {margin: 0px; font-family: monospace;}
        a:link {color: #000099; text-decoration: none;}
        a:hover {text-decoration: underline;}
        table {border-collapse: collapse;}
        .center {text-align: center;}
        .center table { margin-left: auto; margin-right: auto; text-align: left;}
        .center th { text-align: center; !important }
        td, th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
        h1 {font-size: 150%;}
        h2 {font-size: 125%;}
        .p {text-align: left;}
        .e {background-color: #ccccff; font-weight: bold;}
        .h {background-color: #9999cc; font-weight: bold;}
        .v {background-color: #cccccc;}
        i {color: #666666;}
        img {float: right; border: 0px;}
        hr {width: 600px; align: center; background-color: #cccccc; border: 0px; height: 1px;}
        //--></style>

        Yea, I could rewrite the function but that defeats the purpose of having phpInfo in the first place. It's very convenient to use it, esp. as future revisions keep coming... not in the mood of constantly upgrading my own phpInfo 🙂

        Unfortunately, there were no config settings in php.ini I saw that would help me reconfigure this.

        Still looking for a solution 🙁

          hm, if you want to embed the result of phpinfo() into your pages, I'd think you should probably strip off some tags anyway since it outputs a complete html page including <html><header> and so on.

          if you do that, you could strip off the style as well. however, since phpinfo() outputs directly, you would probably need output buffering to be able to do the manipuation, there is an example in the user contributed notes:
          http://www.php.net/manual/en/function.phpinfo.php

          I would not rely on substring() though, rather do it with regular expressions.

            Write a Reply...