Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$_GET and $_POST

Tags:

html

syntax

php

I have a form and the method is set to post on the action page when I use $_POST i dont get the value but if I use $_GET or $_REQUEST I do.

This does not make sense. Could someone just clarify it for me?

The code of the form is

<form action="create.php" method"POST">

Just realized I am missing the = after method.

like image 897
Oliver Bayes-Shelton Avatar asked Dec 09 '22 17:12

Oliver Bayes-Shelton


2 Answers

It sounds like you've misplaced or mistyped the method attribute and your form is defaulting to HTTP GET. The form should look like this:

<form method="post" action="file.html">
like image 78
Johannes Gorset Avatar answered Dec 26 '22 00:12

Johannes Gorset


What's the method set to in the HTML for your form, eg:

<form method="POST" ...>
like image 40
MalphasWats Avatar answered Dec 26 '22 02:12

MalphasWats