Custom PHP Forms in Wordpress?

shane53
125 Posts
shane53 posted this 02 June 2021
Ask a Question

This is not really a Nicepage question, rather a Wordpress questions for any other Wordpress developers who might be out there.

I’m currently using WordPress with the Nicepage page builder. I’m trying to create a custom contact form in a PHP block in Nicepage. This is so I can set up reCaptcha 2 instead of the horrible reCaptcha 3. I’m wondering if it’s possible to actually use something like:

<form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>” method=”post”>

I’m trying handle the form and process the results using a PHP block. Whenever I try to use the action attribute in the form element it goes to a blank page (no matter what page/ permalink I try to send it to on the site). I’m wondering if the action attribute interferes with the CMS handling of the header and it’s impossible to actually to pass a $_POST array to another page in WordPress.

Thanks in advance!

This is not really a Nicepage question, rather a Wordpress questions for any other Wordpress developers who might be out there. I’m currently using WordPress with the Nicepage page builder. I’m trying to create a custom contact form in a PHP block in Nicepage. This is so I can set up reCaptcha 2 instead of the horrible reCaptcha 3. I’m wondering if it’s possible to actually use something like: <form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>” method=”post”> I’m trying handle the form and process the results using a PHP block. Whenever I try to use the action attribute in the form element it goes to a blank page (no matter what page/ permalink I try to send it to on the site). I’m wondering if the action attribute interferes with the CMS handling of the header and it’s impossible to actually to pass a $_POST array to another page in WordPress. Thanks in advance!
Vote to pay developers attention to this features or issue.
1 Reply
Order By: Standard | Newest
Support Team
Support Team posted this 04 June 2021

Hi,

Why don't you want to directly specify the link to the PHP script that should submit the custom form?

...................................................
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, Why don't you want to directly specify the link to the PHP script that should submit the custom form? ................................................... 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
You must log in or register to leave comments