php - if (isset($_post['submit'])) is not working

Solution:
Replace
<input type="submit" name="Submit" value="Submit" />
with
<input type="submit" name="submit" value="submit" />
Answer
Solution:
you can only check - if(isset($_POST['Submit'])). You dont want to check for !empty.
In your input tag you have given name attribute as name="Submit".
so, use $_POST['Submit']
instead of $_POST['submit']
Because post variables are CASE SENSITIVE.
Answer
Solution:
I'd changeif (isset($_POST['Submit'))
toif (isset($_POST['sendIt'))
and then i'd change<input type="submit" name="Submit" value="Submit" />
to:
<input type="submit" name="sendIt" value="Submit" />
This way your form has it's own unique send value rather than the bog standardsubmit
which could lead to future issues if and when you decide to add anymore forms into the website.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: constant expression contains invalid operations
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.