The form is always submitted as GET, even with the POST method.

I have a problem submitting my form. The code is below. When I submit, it is sent as GET, not as POST, although my method is a message. I tried method = "POST" and method = "post". What am I missing here?

<!doctype html> <html> <head> <title>Test</title> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> </head> <body> <div> <?php echo "POST: "; print_r($_POST); echo " GET :"; print_r($_GET); ?> <form role="form" name='test' method="post" action="test2.php"> <label for="name">Name</label> <input name="name" type="text" /> <input type="submit" name="submit" /> </form> </div> </body> 
0
source share

All Articles