Yes it's possible.
For starters, windows.print() is either Javascript or some other language. Not PHP. PHP has two functions to display strings: [man]echo/man and [man]print/man.
Now, You can display anything you'd like and do anything with submitted information you'd like during script execution. That being said, if you wanted to display the data in the form, and then insert that data into the database, you'd just have to do something as simple as:
<?php
// Display the form data:
echo 'The form data is: ' . print_r($_POST, 1);
// Now insert it into the database
$conn = mysql_connect('localhost', 'username', 'password');
mysql_select_db('database', $conn);
mysql_query("INSERT INTO `table` (`column`, `column2`) VALUES ('{$value}', '{$value2}')");
That's very bare-bones, and doesn't escape anything (which is a bad idea). But it demonstrates that you can do multiple things in once script, like displaying what was posted as well as insert data into a database.
The [man]print_r/man function is another function that will display things; however, it will display them in a "human readable" format. So if you give it an array, it will display something like:
Array(
[0] => 'Some String'
[key] => 'some other string'
)
Hope that helps.