plgupa
Forum Replies Created
-
Yes, please help, I still could not update the redirect url.
Hi, I have almost figured it out. The new form is getting created and also I am able to delete the fields. But I am not able to add redirect url to the form. It is always coming blank. I am using below code. Please help.
function create_form(){
$main_form = Forminator_API::get_form(14);
$wrappers = Forminator_API::get_form_wrappers(14);
$settings = $main_form->settings;
$settings['formName'] = 'Form Test 8';
$new_form_id = Forminator_API::add_form(
'Form Test 8',
$wrappers,
$settings
);
Forminator_API::delete_form_field($new_form_id, 'text-1');
Forminator_API::update_form_setting($new_form_id, 'submission-behaviour', 'redirect');
Forminator_API::update_form_setting($new_form_id, 'redirect-url', 'https://url');
}Hi, Thanks for the reply. This is very useful.
I want to duplicate a form through code and then remove few fields (from new form) based on user input. I am doing something like this, but it did not work –
function create_form($field1, $field2, $field3, $redirect){
$main_form = Forminator_API::get_form(14);
$new_form_id = Forminator_API::add_form('Form Test 3', $main_form->$fields, $main_form->$settings);
if($field1==false){
Forminator_API::delete_form_field($new_form_id, 'text-1');
}
if($field2==false){
Forminator_API::delete_form_field($new_form_id, 'text-2');
}
if($field3==false){
Forminator_API::delete_form_field($new_form_id, 'text-3');
}
Forminator_API::update_form_setting( $form_id, 'redirect-url', $redirect);
}Please guide what am I doing wrong?
Hi, sorry for late reply –
- Please confirm if these steps will not have any negative effect on website for SEO or any other functionality.
- Both the steps need to be done or any one?
- .htaccess complete file will look like below? –
<Files *>
SetHandler none
SetHandler default-handler
Options -ExecCGI
Options -Indexes
RemoveHandler .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo
</Files>
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
<IfModule headers_module>
Header set X-Robots-Tag "noindex"
RewriteCond %{HTTP_USER_AGENT} Googlebot
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/forminator/
RewriteRule ^.*$ - [F,L]
</IfModule>Hi, I checked with the hosting team, they said –
- mod_autoindex Apache module is active by default.
- The CSS files are accessible because the .htaccess file placed a restrictive .htaccess in wp-content/uploads/forminator/. The CSS file (like style-1516.css) is still accessible because the `.htaccess rules you applied are aimed at blocking executable files (e.g., PHP, CGI, Python) β not CSS, JS, or other static files. You can add the following rule in the .htaccess file by discussing it with the plugin support to deny access to all the files in the directory – Require all denied
Please tell how to proceed?
- This reply was modified 6 months ago by plgupa.
Hi, I checked –
- htaccess file is already present.
- For path – “https://domain-name/wp-content/uploads/” it is coming forbidden page. For rest of the URLs it is showing blank page.
- I use Cloudways hosting. They use combination of Apache and Nginx (While Nginx serves static content (like images, CSS, and JavaScript files), Apache handles dynamic requests such as PHP processing).
Please guide what should I do next?
Hi,
Thanks for reply. You can tell the custom code that can be added to any simple form. I will apply it to my form. Example:- Please tell the custom code needed for a contact form having Name, Message and Email id fields.
Forum: Plugins
In reply to: [PDF Embedder] Old PDF is shownYes, this worked. I used [pdf-embedder url=”filename.pdf?t=rand(0,10000)”] to generate unique query string every time.
Thanks for help.
- This reply was modified 1 year, 10 months ago by plgupa.
Hi,
Requesting any solution to above query faster. Sorry for rushing, but I have to implement these functionalities before deadline.
Hi,
To anyone looking for solution. I solved my problem using below method:-
- Save the result of form data processing done in action – ‘forminator_custom_form_submit_before_set_fields’ into database table.
- Now, in action – ‘forminator_form_after_save_entry’ edit the inline message based on saved database entry.
Hi,
Thanks for the reply. This filter can change the response message.
But I want to change response message based on some database processing done on form data. In this filter I am not getting form data. Is there any way to get it?
Note:- As mentioned earlier I am using an action to perform database processing – ‘forminator_custom_form_submit_before_set_fields’
Thanks
Hi,
I found out the issue. The caching I am using is slowing down the loading of javascript resources. I disabled that caching feature and now the form is loading faster.
Regards
Hi,
I am using the latest forminator version.
I am using the shared code to add query parameters to redirect URL – https://gist.github.com/wpmudev-sls/619d8140953daac80094abadad0ef66f
I have used the code in the same format but still it is redirecting to new tab.
Please look into it once more, if there is any workaround solution. Meanwhile, I will also keep trying.Hi Adam,
Thanks for the great replies on this thread. You have taught here more wordpress functionalities than I have learnt from YouTube, blogs etc.
Keep helping with your amazing answers. They are really helpful for new developers like me.
Thanks
Hi,
Thanks for the help. You all are doing great work in helping the developers.