Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I display PHP information using phpinfo()?

Tags:

php

I have phpinfo() text which I want to post and display on another PHP page.

My code:

###File index.php

<html>
<form action = "go.php" method = "post">
<input type = "text" name = "msg"><br><br>
<input type = "submit" value = "Submit">
</form>
<html>

###File go.php :

<?php
    $message = $_POST['msg'];
    echo "Message : ". $message;
?>

How can I show PHP info when sending phpinfo() text with post data?

like image 741
Elmi Ahmadov Avatar asked Jul 03 '11 10:07

Elmi Ahmadov


1 Answers

I'm not sure I'm following you, but it sounds like you want to capture the output of phpinfo(). You can do this with output buffering:

<?php
ob_start();
phpinfo();
$info = ob_end_clean();
?>
like image 54
marchaos Avatar answered Sep 27 '22 21:09

marchaos