#24095 [Com]: phpinfo styles override page styles and damage appearance

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #24095 [Com]: phpinfo styles override page styles and damage appearance

    ID: 24095
    Comment by: joe at monkeydepartment dot com
    Reported By: generic at thetahat dot com
    Status: Open
    Bug Type: Feature/Change Request
    Operating System: Windows XP SP1
    PHP Version: 4.3.2
    New Comment:

    This problem still exists in PHP5 and it is obnoxious. It
    would be trivial to set up phpinfo's CSS so it descends from
    a style called "phpinfo". Then phpinfo() could
    enclose itself in a <div class="phpinfo">, without any
    further modifications to itself.

    Like this:
    <style>
    .phpinfo body {style=whatever}
    .phpinfo td {style=whatever}
    .phpinfo table {style=whatever}
    etc, etc, etc
    </style>

    Then anything within a <div class="phpinfo"> will inherit
    those styles. Absolutely basic CSS and it doesn't even
    require changing the actual phpinfo() output.


    Previous Comments:
    ------------------------------------------------------------------------

    [2004-04-01 14:53:17] csaba at alum dot mit dot edu

    Yes, phpinfo is a super function, but it should also be a nice player
    and please not hog the styles on my previously generated elements.
    Here's an example that illustrates this (tried on IE6 on Win2K with PHP
    5.0.0RC1). The TEXTAREA element is supposed to fill the first (multi
    rowspan) TD element. if you uncomment the phpinfo line at the bottom,
    then you'll see that the TEXTAREA element nearly disappears. This is
    because the style sheet genereated by phpinfo sets the TD style to have
    vertical-align:baseline. Notice that the body color changes for similar
    reasons. And the links would change, too, if I had them.

    Csaba Gabor

    <html>
    <head><title>PHP output result page</title></head>
    <body bgcolor=yellow onLoad=
    "var
    mytd=document.getElementById('mytd');mytd.style.he ight=mytd.offsetHeight">
    <table bgcolor="orange" border=1 id=mytd>
    <tr><td rowspan=3><textarea style="width:100%;height:100%">
    This should ALREADY fill the cell</textarea></td>
    <td>One</td></tr>
    <tr><td>Two</td></tr>
    <tr><td>Three</td></tr>
    </table>
    </body>
    </html>
    <?php //phpinfo() ?>

    ------------------------------------------------------------------------

    [2003-06-09 08:52:30] generic at thetahat dot com

    I'm all for using styles on the phpinfo output but since it's
    redefining basic page elements it's difficult to include phpinfo output
    on a page when debugging. The choice of style names are all that need
    to change. For instance, instead of redefining "table", use a class
    name like #phpinfotable and instead of a basic names like ".e" use
    ".phpinfocell", instead of "h1" use "h1.phpinfo", "a:link#phpinfo",
    etc.

    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=24095&edit=1[/url]
    joe at monkeydepartment dot com Guest

  2. Similar Questions and Discussions

    1. CSS styles not showing on styles menu
      Hi, I have a CSS files that contains a couple of classes for font colours. I have ticked the "Include CSS styles in the Style menu" box and...
    2. Usercontrol, add styles via Page.Header.Attributes ?
      I want to add styles to the current page from within a usercontrol the correct(better) way. So i would like to insert the styles in the page head....
    3. Different Link Styles on same page
      I would like to have two different Link Styles on the same page - in the center table I have Bold and RED links but farther down I would like to...
    4. changing type size in paragraph styles and how it effects nested styles
      In a book I'm developing, I decided to up the point size for my "first paragraph" and "body text" in my paragraph styles. I have nested styles in...
    5. Word Styles Replacing My ID Styles
      Hello everyone, I Thought This Was Discussed Here in The Past But I Ran a Search for "Word Styles" and Found Nothing Related. I Send Documents...
  3. #2

    Default Re: #24095 [Com]: phpinfo styles override page styles and damage appearance

    Hi There,

    I saw another thread when googling this problem.

    I now use this

    <?php

    $debugging = true;

    ?>

    <style type="text/css" >

    /* debugging styles reset */
    #debugging {
    background: #fff;
    color: #000;
    padding: 2em;
    margin: 2em;
    border: #ccc 2px solid;
    }

    #debugging h2, #debugging h1 {
    background:none;
    clear:both;
    color:black;
    margin: 0 auto;
    }

    #debugging td, #debugging th {font-family: sans-serif;}
    #debugging pre {margin: 0px; font-family: monospace;}
    #debugging a:link {color: #000099; text-decoration: none; background-color: #ffffff;}
    #debugging a:hover {text-decoration: underline;}
    #debugging table {border-collapse: collapse;}
    #debugging .center {text-align: center;}
    #debugging .center table { margin-left: auto; margin-right: auto; text-align: left;}
    #debugging .center th { text-align: center !important; }
    #debugging td, #debugging th { border: 1px solid #000000; font-size: 75%; vertical-align: baseline;}
    #debugging .p {text-align: left;}
    #debugging .e {background-color: #ccccff; font-weight: bold; color: #000000;}
    #debugging .h {background-color: #9999cc; font-weight: bold; color: #000000;}
    #debugging .v {background-color: #cccccc; color: #000000;}
    #debugging .vr {background-color: #cccccc; text-align: right; color: #000000;}
    #debugging img {float: right; border: 0px;}
    #debugging hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}



    </style>


    <div id="debugging">
    <h2>Debugging on...</h2>
    <?php


    if($debugging == true){

    # HttpRequestDetails.php
    # Copyright (c) 2002 by Dr. Herong Yang, http://www.herongyang.com/
    #
    print "<pre>\n";
    print "\nContents of \$_GET:\n";
    foreach ($_GET as $k => $v) {
    print " $k = $v\n";
    }
    #
    print "\nContents of \$_POST:\n";
    foreach ($_POST as $k => $v) {
    print " $k = $v\n";
    }
    #
    print "\nContents of \$_COOKIE:\n";
    foreach ($_COOKIE as $k => $v) {
    print " $k = $v\n";
    }
    #
    print "\nContents of \$_REQUEST:\n";
    foreach ($_REQUEST as $k => $v) {
    print " $k = $v\n";
    }
    #
    print "\nContents of \$_SERVER:\n";
    foreach ($_SERVER as $k => $v) {
    print " $k = $v\n";
    }
    print "</pre>\n";

    ob_start();
    phpinfo(-1);
    $pinfo = ob_get_contents();
    ob_end_clean();
    $pinfo = preg_replace( '%^.*<body>(.*)</body>.*$%ms','$1',$pinfo);
    echo $pinfo;

    } else {

    # Show no debugging

    }



    ?>
    </div>

    The preg_replace takes out the body. I then wrapped the phpinfo in a div with an id. I used firebug to copy the original styles of phpinfo and pasted then in their own style prefixing with the wrapper. I then styled it how I liked. I removed the native body style that would normally override my site styles. Now customisable.

    phpinfo(-1); shows all the information.

    Thanks

    Andi :o)
    Unregistered Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139