HTML - Contact form - Submit

AlexVelchev
3 Posts
AlexVelchev posted this 28 February 2019
Ask a Question

Hi,

I made a simple HTML website with a contact form. I have a PHP script on my server that correctly sends an e-mail. However, no matter, what I do, the form on the website gives an error message. Do you have any clues how to properly set the script, so that I can get a "Success" message?

Thanks!

Alex

Hi, I made a simple HTML website with a contact form. I have a PHP script on my server that correctly sends an e-mail. However, no matter, what I do, the form on the website gives an error message. Do you have any clues how to properly set the script, so that I can get a "Success" message? Thanks! Alex
Vote to pay developers attention to this features or issue.
15 Replies
Order By: Standard | Newest
Support Team
Support Team posted this 12 October 2022

Hello,

In order to display the successful message with the custom script, the successful status should be received from the server and processed. We provided an example of how to display a successful message in this article
https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form-in-nicepage-website-builder

...................................................
Sincerely,
Olivia
Nicepage Support Team

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

Hello, In order to display the successful message with the custom script, the successful status should be received from the server and processed. We provided an example of how to display a successful message in this article https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form-in-nicepage-website-builder ................................................... Sincerely, Olivia Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
htmlappdev2
1 Posts
htmlappdev2 posted this 11 October 2022

Hi i am experiencing the same issue on all my sites, I am using the URL method to post the form, was this bug ever fixed?

Hi i am experiencing the same issue on all my sites, I am using the URL method to post the form, was this bug ever fixed?
Support Team
Support Team posted this 09 June 2021

Hello Alexander,

Please create a new private topic and send us the URL to your website.
Also, we would need some details regarding your issue with the contact form in Online editor.
Thanks.
...................................................
Sincerely,
Anna T.
Nicepage Support Team

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

Hello Alexander, Please create a new private topic and send us the URL to your website. Also, we would need some details regarding your issue with the contact form in Online editor. Thanks. ................................................... Sincerely, Anna T. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
ratatak
2 Posts
ratatak posted this 09 June 2021

I'm using https://formspree.io URL.

I'm using https://formspree.io URL.
ratatak
2 Posts
ratatak posted this 09 June 2021

I have the same issue, the mail is sent/received but have error message to the user. Is there a fix to this bug?

I have the same issue, the mail is sent/received but have error message to the user. Is there a fix to this bug?
Support Team
Support Team posted this 22 March 2019

Gregor,

Please create a private topic and send us the URL to your website

...................................................
Sincerely,
Chris
Nicepage Support Team

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

Gregor, Please create a private topic and send us the URL to your website ................................................... Sincerely, Chris Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
gkobler
7 Posts
gkobler posted this 19 March 2019

Hello Chris

I have investigate follow: when i execute my script via https://www.mydomain.com/contact.php directly in my browser

i got the follow return code
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 20 { "success": true }

But when i use my contact form, i got the fail message instead the ok message!

I use the Version 1.2.16

Best Regards
Gregor

Hello Chris I have investigate follow: when i execute my script via https://www.mydomain.com/contact.php directly in my browser i got the follow return code HTTP/1.1 200 OK Content-Type: application/json Content-Length: 20 { "success": true } But when i use my contact form, i got the fail message instead the ok message! I use the Version 1.2.16 Best Regards Gregor
gkobler
7 Posts
gkobler posted this 18 March 2019

Hello Chris

How should i adapt the JSON to my PHP-Script? Because i have the same problem, the message was sent, but on my website the message for "not sending" apears!

I use the script where are described at:
https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form

Best Regards and thanks for a hint
Gregor

Hello Chris How should i adapt the JSON to my PHP-Script? Because i have the same problem, the message was sent, but on my website the message for "not sending" apears! I use the script where are described at: https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form Best Regards and thanks for a hint Gregor
Support Team
Support Team posted this 07 March 2019

Karl McVey,

Please don't comment functions in Nicepage.js

This file is generated automatically for each release and function positions will be changed.

In order to receive Success message you need to return the JSON from your PHP script.

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 20

{ "success": true }

...................................................
Sincerely,
Chris
Nicepage Support Team

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

Karl McVey, Please don't comment functions in Nicepage.js This file is generated automatically for each release and function positions will be changed. In order to receive Success message you need to return the JSON from your PHP script. > HTTP/1.1 200 OK > Content-Type: application/json > Content-Length: 20 > > { "success": true } ................................................... Sincerely, Chris Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
karl.jmcvey2
4 Posts
karl.jmcvey2 posted this 01 March 2019

Go into Nicepage.js and comment out function 2672.

Go into Nicepage.js and comment out function 2672.
karl.jmcvey2
4 Posts
karl.jmcvey2 posted this 01 March 2019

I have the same issue Alex. When I deleted the

I have the same issue Alex. When I deleted the
AlexVelchev
3 Posts
AlexVelchev posted this 01 March 2019

Hi Olivia,

I understand the PHP part of the equation and the code works fine. As I said - the issue is with the message the user is getting. The PHP output of the script seems to have no effect. When the user clicks Submit on the form, a JS script is launched, from what I gather. But the jQuery.js file is totally unreadable and I don't know how to edit all that in order to read the $mail_status variable from the PHP script. Is the jQuery.js file expecting a different named variable?

Thanks!
Alex

Hi Olivia, I understand the PHP part of the equation and the code works fine. As I said - the issue is with the message the user is getting. The PHP output of the script seems to have no effect. When the user clicks Submit on the form, a JS script is launched, from what I gather. But the jQuery.js file is totally unreadable and I don't know how to edit all that in order to read the `$mail_status` variable from the PHP script. Is the jQuery.js file expecting a different named variable? Thanks! Alex
Support Team
Support Team posted this 28 February 2019

Hi Alexander,

This line:

if ($mail_status) { ?>

refers to the php variable:

$mail_status = mail($mail_to, $subject, $body_message, $headers);

As an alternative, you can remove form Successful and Failed messages if this code works ok.

Please note that the provided code is just an example found on the internet. You can edit it in the way you need.

DISCLAIMER: Both example codes are used from open resources on the Internet. These examples and were provided for informational purposes only as recommendations. Please note, everything you do with these provided code examples, you do at your own risk.

...................................................
Sincerely,
Olivia
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 Alexander, This line: if ($mail_status) { ?> refers to the php variable: $mail_status = mail($mail_to, $subject, $body_message, $headers); As an alternative, you can remove form Successful and Failed messages if this code works ok. Please note that the provided code is just an example found on the internet. You can edit it in the way you need. > DISCLAIMER: Both example codes are used from open resources on the Internet. These examples and were provided for informational purposes only as recommendations. Please note, everything you do with these provided code examples, you do at your own risk. ................................................... Sincerely, Olivia Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
AlexVelchev
3 Posts
AlexVelchev posted this 28 February 2019

Hi Hella,

Thanks for getting back.

I read the article and implemented the script. The same thing happens. I receive the e-mail, but get this error.

Unable to send your message. Please fix errors then try again.

On the other hand, in my script I've specified this:

if ($mail_status) { ?>

I can see these lines of code in the HTML form section.

<form action="send_form_email.php" method="POST" class="u-form-spacing-10 u-form-vertical u-inner-form" source="custom">
                                                <input type="hidden" id="siteId" name="siteId" value="1589101792">
                                                <input type="hidden" id="pageId" name="pageId" value="791020725">


                                                <div class="u-form-email u-form-group">
                                                    <label for="email-bfc9" class="u-form-control-hidden u-label">Email</label>
                                                    <input type="text" placeholder="Email" id="email-bfc9" name="email" class="u-border-1 u-border-grey-30 u-input u-uppercase u-input-1" required="">
                                                </div>



                                                <div class="u-form-group u-form-message">
                                                    <label for="message-bfc9" class="u-form-control-hidden u-label">Message</label>
                                                    <textarea placeholder="Message" rows="4" cols="50" id="message-bfc9" name="message" class="u-border-1 u-border-grey-30 u-input u-uppercase u-input-2" required=""></textarea>
                                                </div>


                                                <div class="u-form-group u-form-submit">
                                                    <a href="#partners" class="u-btn u-btn-submit u-button-style">Submit</a>
                                                    <input type="submit" value="submit" class="u-form-control-hidden" placeholder="">
                                                </div>
                                                <div class="u-form-send-message u-form-send-success">Thank you! Your message has been sent.</div>
                                                <div class="u-form-send-error u-form-send-message" style="display: none;">Unable to send your message. Please fix errors then try again.</div>
                                            </form>
Hi Hella, Thanks for getting back. I read the article and implemented the script. The same thing happens. I receive the e-mail, but get this error. Unable to send your message. Please fix errors then try again. On the other hand, in my script I've specified this: if ($mail_status) { ?> I can see these lines of code in the HTML form section. <form action="send_form_email.php" method="POST" class="u-form-spacing-10 u-form-vertical u-inner-form" source="custom"> <input type="hidden" id="siteId" name="siteId" value="1589101792"> <input type="hidden" id="pageId" name="pageId" value="791020725"> <div class="u-form-email u-form-group"> <label for="email-bfc9" class="u-form-control-hidden u-label">Email</label> <input type="text" placeholder="Email" id="email-bfc9" name="email" class="u-border-1 u-border-grey-30 u-input u-uppercase u-input-1" required=""> </div> <div class="u-form-group u-form-message"> <label for="message-bfc9" class="u-form-control-hidden u-label">Message</label> <textarea placeholder="Message" rows="4" cols="50" id="message-bfc9" name="message" class="u-border-1 u-border-grey-30 u-input u-uppercase u-input-2" required=""></textarea> </div> <div class="u-form-group u-form-submit"> <a href="#partners" class="u-btn u-btn-submit u-button-style">Submit</a> <input type="submit" value="submit" class="u-form-control-hidden" placeholder=""> </div> <div class="u-form-send-message u-form-send-success">Thank you! Your message has been sent.</div> <div class="u-form-send-error u-form-send-message" style="display: none;">Unable to send your message. Please fix errors then try again.</div> </form>
Support Team
Support Team posted this 28 February 2019

Hi Alexander,

Please refer to this article:
https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form-in-nicepage-website-builder

I hope that it can be helpful.

...................................................
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 Alexander, Please refer to this article: https://nicepage.com/doc/article/25066/how-to-create-a-simple-html-contact-form-in-nicepage-website-builder I hope that it can be helpful. ................................................... 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