submit two file input fields in the same form

I have a form which has two file input fields, when I try to submit the form it takes only the first one and ignore the second one!

here is my form

<form method="POST" name="vendor_form" enctype="multipart/form-data">  <div class="mb-3" style="margin-bottom: 20px;">             <label for="file_metabox" class="form-label">file metabox</label>             <input class="form-control" type="file" id="file_metabox" name="file_metabox[]" multiple="multiple">         </div>         <div class="mb-3" style="margin-bottom: 20px;">             <label for="file_cert" class="form-label">file Cert</label>             <input class="form-control" type="file" id="file_cert" name="file_cert[]" multiple="multiple">         </div> <button type="submit" class="btn btn-primary" id="submit" name="submit">Submit</button> 

and here is the php

if (isset($  _FILES['file_metabox'])) {     $  file_metabox = $  _FILES['file_metabox'];     foreach ($  file_metabox['name'] as $  key => $  value) {         if ($  file_metabox['name'][$  key]) {             $  file = array(                 'name' => $  file_metabox['name'][$  key],                 'type' => $  file_metabox['type'][$  key],                 'tmp_name' => $  file_metabox['tmp_name'][$  key],                 'error' => $  file_metabox['error'][$  key],                 'size' => $  file_metabox['size'][$  key]             );             $  _FILES = array("file_metabox" => $  file);             foreach ($  _FILES as $  file => $  array) {                 // $  newupload = frontend_handle_attachment( $  file, $  post_success );                 if ($  _FILES[$  file]['error'] !== UPLOAD_ERR_OK) __return_false();                  require_once(ABSPATH . "wp-admin" . '/includes/image.php');                 require_once(ABSPATH . "wp-admin" . '/includes/file.php');                 require_once(ABSPATH . "wp-admin" . '/includes/media.php');                  $  attach_id = media_handle_upload($  file, $  post_success);                  add_post_meta($  post_success, 'file_metabox', $  attach_id);             }         }     }     } if (isset($  _FILES['file_cert'])) {     $  file_cert = $  _FILES['file_cert'];     foreach ($  file_cert['name'] as $  key => $  value) {         if ($  file_cert['name'][$  key]) {             $  file = array(                 'name' => $  file_cert['name'][$  key],                 'type' => $  file_cert['type'][$  key],                 'tmp_name' => $  file_cert['tmp_name'][$  key],                 'error' => $  file_cert['error'][$  key],                 'size' => $  file_cert['size'][$  key]             );             $  _FILES = array("file_cert" => $  file);             foreach ($  _FILES as $  file => $  array) {                 // $  newupload = frontend_handle_attachment( $  file, $  post_success );                 if ($  _FILES[$  file]['error'] !== UPLOAD_ERR_OK) __return_false();                  require_once(ABSPATH . "wp-admin" . '/includes/image.php');                 require_once(ABSPATH . "wp-admin" . '/includes/file.php');                 require_once(ABSPATH . "wp-admin" . '/includes/media.php');                  $  attach_id = media_handle_upload($  file, $  post_success);                  add_post_meta($  post_success, 'file_cert', $  attach_id);             }         }     } } 

Get selected string from TextMeshPro input field/text on Android

i am trying to create a tag system for a journal i’m making and that requires being able to select specific parts from either an input field or a text element with the finger (drag and select) and then save that selection into a list.

The issue is i don’t know how to do it! i did some google research in terms of "saving selected text from input fields" and similar searches but i couldn’t find something to help me out.

The flow should be : user types something like "hello world" , then he drags his finger on the screen highlighting the word "World" and once highlighted it is saved into an empty string which then i can add to the list i want.

Can i get some help or recommendations on what to read to make it happen? Thank you!

WordPress Changing input values

I’m trying to write a plugin, I keep my address records in my cart and I want to automatically fill my data with the input values on the payment page, but I couldn’t find it.

Following is my code:

add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields'); function custom_override_checkout_fields($  fields) { global $  wpdb;  $  list= $  wpdb->get_results("SELECT * From wp_adress");     foreach ($  list as $  value) {         $  firstname = $  value->firstname;         $  lastname = $  value->lastname;         $  phone = $  value->phone;     }     $  fields['billing']['billing_first_name']['value'] = '<?php echo $  value->firstname ?>';     $  fields['shipping']['shipping_first_name']['value'] = '<?php echo $  value->firstname ?>';     $  fields['shipping']['shipping_last_name']['value'] = '<?php echo $  value->lastname ?>';     $  fields['billing']['billing_phone']['value'] = '<?php echo $  value->phone ?> ';     return $  fields; } 

I just want to auto-fill the data in the database on the form checkout page.

Thanks in advance.

Call external API in wordpress based on user input

I want to create a simple wordpress website in which I want to display a search box on a page. On searching a string in text/search box, an external API call should be made based on that string and the data returned by the API should be shown to user. I have successfully referred code from below URL so far –

But I am not able to make a call to API based on string passed in text box. I have done below code so for in the child theme file page:-

<div id="primary" <?php generate_do_element_classes( 'content' ); ?>>     <main id="main" <?php generate_do_element_classes( 'main' ); ?>>         <form action="" method="post">         Enter query:         <input type=text name="t1">         <br>         <br>         <input type=submit name="s">         <?php         /**          * generate_before_main_content hook.          *          * @since 0.1          */         do_action( 'generate_before_main_content' );          if(isset($  _POST['s'])){         echo "good";             $  curl = curl_init();          curl_setopt_array($  curl, [             CURLOPT_URL => "******API URL*****/".$  _POST['t1'],             CURLOPT_RETURNTRANSFER => true,             CURLOPT_FOLLOWLOCATION => true,             CURLOPT_ENCODING => "",             CURLOPT_MAXREDIRS => 10,             CURLOPT_TIMEOUT => 30,             CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,             CURLOPT_CUSTOMREQUEST => "GET",             CURLOPT_HTTPHEADER => [                 "x-rapidapi-host: XYZ",                 "x-rapidapi-key: ABc"             ],         ]);          $  response = curl_exec($  curl);         $  err = curl_error($  curl);          curl_close($  curl);          if ($  err) {             echo "cURL Error #:" . $  err;         } else {             echo $  response;         }     }                           /**          * generate_after_main_content hook.          *          * @since 0.1          */         do_action( 'generate_after_main_content' );         ?>         </form>     </main> </div>  <?php /**  * generate_after_primary_content_area hook.  *  * @since 2.0  */ do_action( 'generate_after_primary_content_area' );  generate_construct_sidebars();  get_footer(); 

When I click on Submit button, it gives ‘Page not Found’.

SQL Dynamic Query based on user input in PowerBI

I am pulling data from inSQL using the SQL Query below:

SET QUOTED_IDENTIFIER OFF  SELECT * FROM OPENQUERY(INSQL, "SELECT DateTime, [X],[Y], [Z], [A]  FROM WideHistory  WHERE wwRetrievalMode = 'Cyclic'  AND wwResolution = 1000  AND wwVersion = 'Latest'  AND DateTime >= '20210601 20:02:33.000'  AND DateTime <= '20210607 20:02:34.000'") 

I’m using this table in PowerBI and want [X],[Y], [Z], [A] & the DateTime values to dynamically change based on user input.

Any advice on this would be greatly appreciated. I am new to PowerBI and SQL.

How to keep WP from creating a “single-post” page and let the user input the link of the post in the dashboard?

I have this very specific questions. On my homepage I decided to show excerpts of the latest news and events with a "while" loop. The issue is that I want the admin to define what the permalink will be of said post, and not have a /event/lorem-ipsum page for each event. The idea is to link those excerpts to Instagram posts, Facebook posts, or whatever…

My custom_post_type function is:

register_post_type('event',      array(         'rewrite' => array('slug' => 'events'),         'labels' => array(             'name' => 'Events',             'singular_name' => 'Event',             'adding_new_item' => 'Add event',             'edit_item' => 'Edit event'         ),         'menu-icon' => 'dashicons-calendar-alt',         'public' => true,         'has_archive' => true,         'supports' => array(             'title', 'thumbnail', 'editor',          )     ) ); 

Function providing input and integration limits for NIntegrate

I am trying to define some custom function that evaluates the numeric integral of some complicated function. The problem is that I would like to include as an input the integration limits. A MWE follows

f[x_,y_]:= Exp[-2 x^2 y^2] test[x_?NumericQ,IntL_]:= NIntegrate[f[x, y],IntL] myIntL1= {y,-4 x^2,4x^2}; myIntL2= {y,-4 x^4,4x^4}; 

Then, if I evaluate for instance test[3,myIntL1] I get a problem concerning an invalid limit of integration.

Is there a clever way to fix this without defining several functions including the integration limits, such as

    test1[x_?NumericQ,IntL_]:= NIntegrate[f[x, y],{y,-4 x^2,4x^2}]     test2[x_?NumericQ,IntL_]:= NIntegrate[f[x, y],{y,-4 x^4,4x^4}] 


Of course, here everything looks simple, but in my case all the functions are rather long; some even purely numeric ones. Since I have multiple choices for the integration limits, it would be more practical to avoid defining test1[x_], test2[x_], ..., testN[x_]

Thanks in advance, Pablo

display an input string many times

I’d like to create a function that add 2 to an integer as much as we want. It would look like that:

>>> n = 3  >>> add_two(n) Would you like to add a two to n ? Yes The new n is 5 Would you like to add a two to n ? Yes the new n is 7 Would you like to add a two to n ? No 

Can anyone help me please ? I don’t how I can print the sentence without recalling the function.