PHPINFO overrides CSS code I start page with
Moderator: General Moderators
PHPINFO overrides CSS code I start page with
I want to see PHPINFO but would like to keep my original CSS for everything on the page except PHPINFO. How would I go about this?
phpinfo security
It's on a secure page requireing login and a high permission level. I just hate the way it takes over the style info for my intranet admin page.
phpinfo() outputs a complete page, complete with the style declarations in the head. When those declarations are parsed, they are applied to the whole document. Probably the easiest solution would be to put phpinfo() in it's own page, and show it through an iframe.
edit: just read the docs on phpinfo() - if you call:
You should be able to get around it. This of course, assumes you can run PHP as a CLI.
edit: just read the docs on phpinfo() - if you call:
Code: Select all
echo '<pre>'.shell_exec("php -r 'phpinfo();'").'</pre>';
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Thanks for both ideas.
I do have CLI and that worked fine but then the output looks kind of crude. I went with the iframe idea. I usually try to avoid frames but in this case it was the best solution to date.
Here is what I ended up with:
Thanks for the help pickle 
Here is what I ended up with:
Code: Select all
if (!$phpinfo){ echo "<table><tr><td><iframe SRC='$php_self?phpinfo=1' width=850 height=600></iframe></td></tr></table>"; }
if ($phpinfo){ phpinfo(); $phpinfo=''; }