如何从<form action>打印?

I have the following code in post.php:

    <?php
set_magic_quotes_runtime(0);

if (isset($_GET['debug'])) {
    echo '<pre>';
    print_r($_POST);
} else {
    echo stripslashes($_POST['editor']) ;
} 

And at the main page there is a form button that calls post.php with a post action and export everything within a div. How can configure it to print the exported page when I click that form button?

AJAX, PHP, JQUERY, JAVASCRIPT ???

In order to obtain anything from a submitted form (method=post) in PHP, there is the global $_POST as you have discovered. The keys (debug, editor) in that array correspond to the name attributes of select, textarea and input fields from the submitted form. They are not the same as jQuery selectors, meaning you can not export everything from a div unless you use JavaScript to set the value attribute of an input to the content of that div.

crude example:

<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>

<script>
$(document).ready(function(){

    $('input[name="post"]').click(function(ev){
        ev.preventDefault();

        console.log('click');
        $('form').append(
            $('<input name=div type=hidden>').val($('div').html())
        );

        setTimeout(function(){
            $('body').prepend('SENDING<br>');
            $('form').submit();
        }, 333);
    });
}
);
</script>

</head>
<body>
<form method="POST" action="moo.php">
<textarea name="summary" cols=80 rows=3>
Zuma is a big man
</textarea>
<br>

<input type="text" name="what" value="zuma?">
<br>

<select id="" name="">
<option value="55">schfifty five</option>
<option value="2">doo</option>

</select>
<br>

<input type="submit" name="post" value="send">
</form>
<pre>
<?php print_r($_POST); ?>
</pre>

<div> random stuff <span> foobar </span>
</div>

<body>
</html>