submit button not work

Maybe you should add action=”” in

echo'<form method="post">';

change to:

echo'<form method="post" action="">';