Результат формы на той же странице

Я посетил следующую ссылку

Теперь у меня есть 2 образца файлов Содержание test2.php

<!DOCTYPE html> <html> <head> <title> Form </title> </head> <body> <?php include_once("test.php"); ?> </body> </html> 

Содержание test.php

 <?php if (isset($_POST['submit'])) { $arr=array(); foreach ($_POST as $key => $value) { $arr[$key]=$value; } print_r($arr); } ?> <!DOCTYPE html> <html> <head> <title> Form </title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <link rel="stylesheet" href="css/main.css" /> </head> <body> <div id="content" id="login_form"> <form method="post" id="f1" name="f1" action="test.php"> <table> <tr> <td>Name :</td><td><input type="text" name="name"/></td> </tr> <tr> <td>Register Number :</td><td><input type="text" name="regno"/></td> </tr> <tr> <td>Date of Birth :</td><td><input type="text" name="dob"/></td> </tr> <tr> <td><input type="submit" id="b1" name="submit" value="Submit" style="font-size:16px;"/></td> </tr> </table> </form> </div> <script> $('#f1').submit(function() { $.ajax({ data: $(this).serialize(), type: $(this).attr('post'), url: $(this).attr('test.php'), success: function(response) { $('#content').html(response); } }); return false; }); </script> </body> </html> 

test2.php отображает форму. I want to display the values entered in the form and the form после нажатия кнопки «Отправить», но я вижу только форму. это потому, что $ _POST пуст или потому, что я ошибся в структуре самой страницы?

Изменить: я хочу, чтобы результат отправки формы загружался на страницу test2.php.