Hello all and thank you for your previous help. I finally managed to get my mail function working. Is there anyway to make this code safer against spam injections etc. I have tried adding lines but can’t get it to work properly. Can anyone give me some clues as to what lines and where I need to add. Thank you so much and I hope this is the right forum to post. I am such a beginner using PHP.
Yes, you should include that check somewhere before you call the [fphp=mail]mail()[/fphp] function, and refuse to send the message if the ‘email’ parameter contains line breaks or other suspicious characters.
Be careful if you use a regular expression to validate the ‘email’ parameter, since regular expressions by default stop matching at a CR or LF character. You will then need to supply a ‘multi-line’ flag to make it perform the match on the whole string.
Thanks again. I am not sure about regular expressions. The code above is pretty much the code I have used with the addition of some function commands. So you mean I should add it before the $mail command somewhere?