Stopping empty form submission PHP

前端 未结 4 1347
一整个雨季
一整个雨季 2021-01-28 05:00

I have been trying to implement server validation to prevent blank emails in my contact us page, but I am not sure on how to do it in PHP, here is my code:



        
4条回答
  •  天命终不由人
    2021-01-28 05:17

    Before your $mail_to..

    You can validate the _POST/_GET first on server side.

    
    

    Alternatively, you can validate first on the client-side. It will save you time and resources.

提交回复
热议问题