HTML - Contact form - Submit

AlexVelchev
3 Posts
AlexVelchev posted this 28 February 2019

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.
10 Comments
Order By: Standard | Newest
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
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,

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 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
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
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.
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
gkobler
6 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
gkobler
6 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
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
You must log in or register to leave comments