I've written the following php script specifically for Hostgator Linux share-servers hosting service to interface with Nicepage Contact forms. It uses the contact.php form suggested by Nicepage with minor changes. It works great...
<?php script written for use with hostgator linux shared server and nicepage contact forms use and ftp like filezilla to put this public_html/cgi-bin/ folder or directory on server point to this file in nicpage with the form, send to, url text box and it will be executed in html with the form action command. a different named "contact.php" will be needed for each new email where the form info goes $field_name $field_email $field_message comment out either or both of the following two if not in form $field_phone $field_address mail_to below sends the email to the person's email designated on next line $mail_to ; $mail_from ; $subject .$field_name; the email content: $body_message .$field_name."\n"; $body_message . .$field_email."\n"; comment out either or both of the following two if not in form $body_message . .$field_phone."\n"; $body_message . .$field_address."\n"; $body_message . .$field_message; $headers .$mail_from."\r\n"; $headers . .$field_email."\r\n"; $mail_status $subject, $body_message, $headers); show a json message about the successful or unsuccessful sending a message if ($mail_status) { $resarray?> true);
header('Content-Type: application/json');
echo json_encode($resArray);
} else {
$resArray= array('success' => false);
header('Content-Type: application/json');
echo json_encode($resArray);
}
?>