Securing a contact form script

后端 未结 2 1875
有刺的猬
有刺的猬 2021-01-28 20:24

Hello! I am just wondering how secure is this contactform script I just made? My teacher was nagging at me a long time ago when I made my contactforms.

2条回答
  •  青春惊慌失措
    2021-01-28 21:11

    There is nothing insecure in your code really beside lack of data validation. You just collect form data and send it out. so the only 'insecurity' is that you would be easily spammed through that form unless any sort of captcha is used. I am not sure at the moment, but it may be possible to trick mail() to add more receipients with crafted $subject, so it would be save to ensure it's oneliner and strip any CRLFs

提交回复
热议问题