Ask a Question related to PHP Bugs, Design and Development.
-
joe at monkeydepartment dot com #1
#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
-
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... -
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.... -
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... -
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... -
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... -
Unregistered #2
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



Reply With Quote

