PHP Code losing its values when I hit submit

前端 未结 1 954
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-24 09:55

I created this piece of code as part of a practise exercise, however it is not working as intended, I pinpointed the issue to the PHP code losing the values I input via text box

相关标签:
1条回答
  • 2021-01-24 10:11

    It should be if(!empty($_POST... everywhere.

    The exclamation mark is missing, which would mean that he would only get data if the field were empty, as per the comment above "why are you sanitizing empty data?" from @chris85. Hence everything should have if(!empty...

    except for

         if (empty($_POST["name"])) {
         if (empty($_POST["customeremail"])){
    
    0 讨论(0)
提交回复
热议问题