Page 1 of 1
PHPINFO overrides CSS code I start page with
Posted: Wed Oct 04, 2006 10:08 am
by churt
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?
Posted: Wed Oct 04, 2006 3:04 pm
by nickvd
Why would you want to?
You dont EVER want phpinfo()'s output visible to the public, it exposes FAR too much information about the server and it's configuration...
phpinfo security
Posted: Wed Oct 04, 2006 3:28 pm
by churt
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.
Posted: Wed Oct 04, 2006 5:42 pm
by pickle
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:
Code: Select all
echo '<pre>'.shell_exec("php -r 'phpinfo();'").'</pre>';
You should be able to get around it. This of course, assumes you can run PHP as a CLI.
Thanks for both ideas.
Posted: Thu Oct 05, 2006 6:54 am
by churt
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:
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=''; }
Thanks for the help pickle
