fpdf - pdf sent as attachment using Pear Mail class - email with blank pdf being sent from server

Hi -

I'm using fpdf with Pear Mail class to send form results as a PDF email attachment.

When the form is submitted, the PDF is generated and all works well.

My issue is that the email with PDF attachment seems to be being sent from the server with blank results - in other words - the form is not being filled in (I know this because I inserted a hidden field in the form and the blank PDF did not print that value). So, this seems to be coming from the server somewhere - I'm getting 1 or 2 a week - just random.  Any ideas?
Who is Participating?
Mahdii7Connect With a Mentor Commented:
I would check the following:

Can a form be submitted with no data? If so, you may want to add server-side validation so that the mail doesn't get set unless the required fields are filled out. JavaScript validation wouldn't be sufficient in your case (or anyone's really) as some users and virtually all spiders have JS 'disabled'.

Record $_SERVER['REMOTE_ADDR'] somewhere in the PHP just before it sends out the email. I wouldn't be surprised if the culprit was a search engine spider accessing pages not excluded in your robots.txt. To remove the pages you don't want to be indexed (and executed) here is a robots.txt 'tutorial'.


Good Luck
phillystyle123Author Commented:
I'm guessing this is the issue - thanks so much for the help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.