php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #24095 phpinfo styles override page styles and damage appearance
Submitted: 2003-06-09 08:52 UTC Modified: 2015-01-08 22:32 UTC
Votes:9
Avg. Score:4.4 ± 0.5
Reproduced:9 of 9 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (11.1%)
From: generic at thetahat dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.2 OS: Windows XP SP1
Private report: No CVE-ID: None
 [2003-06-09 08:52 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-01 14:53 UTC] 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.height=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() ?>
 [2006-10-14 20:58 UTC] joe at monkeydepartment dot com
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.
 [2015-01-08 22:32 UTC] ajf@php.net
-Status: Open +Status: Not a bug -Package: Feature/Change Request +Package: *General Issues
 [2015-01-08 22:32 UTC] ajf@php.net
phpinfo() isn't meant to be embedded.

Use an iframe.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC