Code to insert email address in basic PHP contact form?

Hi All,

I have a basic PHP contact form on a website I created. Basically it is there to allow the website user to fill in some basic information and once they hit submit, it emails the content of the form that they filled in directly to my client’s email address.

My client would like to have the user’s email address appear in the subject line when they (the client) receives the email with the form’s content.

I am looking for a way to take the email address that the user fills in, in the “email address” form field on the website and have it place into the subject line of the email that goes to my client with the form contents.

Is there anyone that could help me with this? I would greatly apprecitate it! Thanks!!!

The email address of the sender/form visitor will be stored in a variable in the PHP script, right? Rather than copying it directly into the subject field of the form, where it’s up for the visitor to see and remove, you could append the contents of the subject with the value of the email address in the script just before calling the mail() function.

Sponsor our Newsletter | Privacy Policy | Terms of Service