sending an email from my website project

Hi.i need your urgent as my project is almost due.i found the following code:

<?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else {//send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("[email protected]", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } } else {//if "email" is not filled out, display the form echo " Email:

"; } ?>

i understand it all but want to make sure of something. on this line - , must i create a mailform.php file.and if i do,what do i put inside of it.

Thanks for your time and consideration.

action=‘mailform.php’ is where the form will send the data to so you will need to create it and put the code you want to handle the form submission in it.

Looking at the code you posted it looks like that handles the form data so instead of having the form send the data to mailform.php you could just change mailform.php in action=‘mailform.php’ to the filename of the file that contains code posted and it should work.

Sponsor our Newsletter | Privacy Policy | Terms of Service