Form submissions

jimwartnick
4 Posts
jimwartnick posted this 22 April 2025
Ask a Question

I am trying to put a page together that accepts a form submission. The only form I've seen on Nicepage is a contact form, which is fine. I've changed submit from e-mail to URL. That submission does a post to a URL where I process the information. I can see the call coming through my server and everything seems ok, however, after code finishes, the page simply shows: "Unable to send your message. Please fix errors then try again.". I don't know if this only accepts email pages, or if it's expecting some response that I'm not returning. Confused as there's no documentation that says how to process forms using Nicepage apps.

Vote to pay developers attention to this features or issue.
1 Reply
Order By: Standard | Newest
jimwartnick
4 Posts
jimwartnick posted this 22 April 2025

I figured it out. I used the response found on the "PHP Script Sample For Contact Form Submission" help section, specifically:

if ($success) {
$resArray= array('success' => 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 used that to respond and it worked.

You must log in or register to leave comments