The Big Spring Sale! Up to 50% off!

Contact Forms php script for Hostgator Linux servers that works great

johnny.fowler2
58 Posts
johnny.fowler2 posted this 18 September 2019
Report a bug

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);
}
?>

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... &lt;?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 &quot;contact.php&quot; 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&#39;s email designated on next line $mail_to ; $mail_from ; $subject .$field_name; the email content: $body_message .$field_name.&quot;\n&quot;; $body_message . .$field_email.&quot;\n&quot;; comment out either or both of the following two if not in form $body_message . .$field_phone.&quot;\n&quot;; $body_message . .$field_address.&quot;\n&quot;; $body_message . .$field_message; $headers .$mail_from.&quot;\r\n&quot;; $headers . .$field_email.&quot;\r\n&quot;; $mail_status $subject, $body_message, $headers); show a json message about the successful or unsuccessful sending a message if ($mail_status) { $resarray?&gt; true); header('Content-Type: application/json'); echo json_encode($resArray); } else { $resArray= array('success' => false); header('Content-Type: application/json'); echo json_encode($resArray); } ?>
Vote to pay developers attention to this features or issue.
2 Replies
Order By: Standard | Newest
johnny.fowler2
58 Posts
johnny.fowler2 posted this 18 September 2019

I noticed that the php script is not visible. I've attached a copy file as a contact.txt
Rename to contact.php on download.

I noticed that the php script is not visible. I've attached a copy file as a contact.txt Rename to contact.php on download.
Support Team
Support Team posted this 19 September 2019

Hi JOHNNY,

Thanks for sharing. I hope that your solution will help other users as well.

...................................................
Sincerely,
Hella
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi JOHNNY, Thanks for sharing. I hope that your solution will help other users as well. ................................................... Sincerely, Hella Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
You must log in or register to leave comments