navasahmed
Forum Replies Created
-
Hello,
Any updates on the above query? the issue is still on the site. we can upload renamed files. here I will breaf down my question.
if game.exe is renamed as game.pdf and uploaded then it needs to be blocked. currently, it’s not blocking.
I have checked your shared code and it’s only checking the wp_check_filetype() I think it only gives the file extension, not checking the file mime type. can you please check it the issue.
also please check your mail. i have contacted through there also.
Thanks
Forum: Plugins
In reply to: [Contact Form 7] Add MIME type ValidationAny update on the above request? it’s very urgent.
Thanks
Forum: Plugins
In reply to: [WP Add Mime Types] Working on contact from 7Thanks for your reply.
I have one doubt. if you can help please help me. am using this code for validating the mime. but when am trying the code. the file path can’t readable in WordPress. in core file it’s working.
add_filter('wpcf7_validate_file*', 'cf7_custom_file_validation', 10, 2); add_filter('wpcf7_validate_file', 'cf7_custom_file_validation', 10, 2); function cf7_custom_file_validation ($result, $tag) { if ($tag->name === 'file-234') { $filepath =$_FILES['file-234']['tmp_name']; // var_dump(mime_content_type($filepath)); $contentType = mime_content_type($_FILES['file-234']['tmp_name']); if ($contentType !== 'application/pdf') { $result->invalidate($tag, 'This file type is not supported'); } } return $result; }
- This reply was modified 2 years, 4 months ago by navasahmed.
- This reply was modified 2 years, 4 months ago by navasahmed.
Forum: Plugins
In reply to: [Contact Form 7] Add MIME type Validationam stuck on this issue. kindly please help me to find out the solution.
mime_content_type($_FILES[$tag->name]['tmp_name']);
is giving bool(false) response.Thanks
Forum: Plugins
In reply to: [Contact Form 7] Validate existing email addressHi,
Thanks for your reply. did you do this on your site? on that doc, they giving like this
if ( Flamingo_Contact::find( array( 's' => '[email protected]' ) ) ) { // email exists }
where should I use this and also how we can assign the dynamic value in array?
i will attach one code that I have tried.
/*We created the filter*/ add_filter( 'wpcf7_validate', 'email_already_in_db', 10, 2 ); /*We created the function*/ function email_already_in_db ( $result, $tags ) { // We take the information from the form being submitted $form = WPCF7_Submission::get_instance(); /*Here is the form ID of the Contact Form*/ $email = $form->get_posted_data('Email-sub'); /*Here is the email field*/ // date_default_timezone_set('America/Sao_Paulo'); /*We set the time zone*/ // $datetoday = date("Y-m-d"); /*We take the current date in the format that the contact plugin records the date*/ global $wpdb; /*We make a select in the table where the contacts are recorded, checking if the email informed already exists on today's date */ $entry = $wpdb->get_results( "SELECT * FROM wp_cf7_vdata_entry WHERE value LIKE '%$email%'" ); // var_dump($entry); // exit(); // If the select query in the database is positive (the email exists on the current date), it returns the error in the form, in the email field, not sending if (!empty($entry)) { $result->invalidate('email', 'Email already exists'); } return $result; }
Forum: Plugins
In reply to: [Contact Form 7] Add MIME type Validationany update on the above query? please give me an update
Forum: Plugins
In reply to: [Contact Form 7] Date filed max and minimum validation not workingI have done that on my local device. if am share the the any of issue site URLs in a private chat is that possible?
Forum: Plugins
In reply to: [Contact Form 7] Validation Message IssueIs that in my local system, so can’t share. I have checked this doc too I can see the validation works when clicking the radio button. https://contactform7.com/checkboxes-radio-buttons-and-menus/#demo
Also for check box also the same issue. when selecting a value from the check box it automatically validates the above fields. please check that demo.Kindly please check it. How we can remove this functionality?
Thanks ??
Forum: Plugins
In reply to: [Contact Form 7] Custom validation not working on latest versionHi,
Did you check my reply above? please check that and give an update.
Thanks.
Hello,
Any update on the above query?
Thanks
Forum: Plugins
In reply to: [Contact Form 7] Custom validation not working on latest versionI apologize for mentioning your name, I thought it would receive a fast response.
Please Check the empty field value error message. Please add this code to your site and check it. The difference between the latest version and version 5.5.6.1 can be seen then.
add_filter('wpcf7_validate_text', 'custom_text_validation', 1, 2); add_filter('wpcf7_validate_text*', 'custom_text_validation', 1, 2); function custom_text_validation($result, $tag) { $type = $tag->type; $name = $tag->name; if($name == 'Name') { $value = $_POST['Name']; $len= strlen($value); if($value==''){ $result->invalidate($tag, "Please enter your name."); } } return $result; }
Thanks
- This reply was modified 2 years, 6 months ago by navasahmed.
Forum: Plugins
In reply to: [Contact Form 7] Custom validation not working on latest versionhello,
I have responded to your reply. You didn’t notice that. Please let me know what the issue is, and I have attached a screenshot.
Here is the message I sent previously.
“Here am attaching the screenshot of the forms. this is a screenshot for version 5.6.1 https://snipboard.io/cSusk3.jpg and this is for version 5.5.6.1 https://snipboard.io/obIpS9.jpg. kindly please check the custom validation message issue for empty fields.”
Thanks
Hello @glenwpcoder,
Did you try adding a drag-and-drop field at the end of the form? If so, please add the field between any other fields, like https://snipboard.io/BjAOMQ.jpg. Afterwards, add this code and check the validation for the Drag and Drop field and also for the fields after that.
Thanks
Forum: Plugins
In reply to: [Contact Form 7] Custom validation not working on latest versionHello @glenwpcoder,
Another issue I am facing is that the mandatory filed error does not appear after the drag and drop field https://snipboard.io/LtpY2j.jpg.
Also, I’ve tried printing $files & $type but the form keeps loading.
Thanks