javascript – Call the jquery function from PHP

Well, since the question is basically the title, how do I call a jquery function in a PHP?
I tried different things on the internet, but I do not know why they do not work for me and then entered the important code.

The part I call:

  
    
     
  

The part in which I create the script:

 
  



php – Undefined index: varieble of AJAX

Good morning community I am facing a problem that I can not solve and I would appreciate your cooperation

it happens and I have 4 select dependent on Ajax requests to the server, because they are well loaded, all select, but at the time of sending the variables that are the options selected from the selection, the services identify not these variables

This is the PHP file that fills in the selection

Query ($ sql);

$ string = "
            ";

mysqli_close ($ connection);
?>

and in the html I show it that way

well, if I try to pass a variable of the selection "" name = process "" to a form

$ process = $ connection-> real_escape_string (utf8_decode ($ _ POST['proceso']));

This error occurs

Note: Undefined index: process

Can anyone help me how to get this variable coming from Ajax and written in a div?

regex – php preg_match with several patterns

I'm trying to combine two preg_match patterns separately with, |.

/ blog  / page  /[0-9]+  /? $ / with / tag  / in / blog / page / and / tag / jump
/Page/[0-9]+  /? $ / with /[0-9]+  /? $ / ex. / page / 2 / and only / 2 /
/(Page/[0-9]+  /?) $ / with / ([0-9]+  /?) $ /

Function redirect_pagination () {
if (! preg_match (& # 39; / blog  / page  /[0-9]+  /? $ /, |, / tag  / & # 39 ;, $ _SERVER['REQUEST_URI'])) {
if (preg_match (& # 39; / page  /[0-9]+  /? $ /, |, /[0-9]+  /? $ / & # 39 ;, $ _SERVER['REQUEST_URI'])) {
$ new_url = preg_replace (& # 39; / (page  /[0-9]+  /?) $ /, |, / ([0-9]+  /?) $ / & # 39 ;, & # 39; # $, $ _SERVER['REQUEST_URI']);
wp_redirect ($ new_url, 301);
Exit;
}
}
}
add_action ('init', 'redirect_pagination', 1);

json – array print php

Good evening!

I have the following code:


And I can not print the array with broken line type, the information is next to each other.

Picture of how the code comes out

The attached image shows how the information is output, and the image also contains a notepad that indicates how exactly the information should be printed.

Any suggestions?

php – Refactor File Upload to search for existing filenames and append -1, -2, -3

I have an existing front-end file upload works fine, but I want it to check if an existing file has the same name and appends "-1", "-2", "-3", and so on.

I have searched for and found a possible solution: https://stackoverflow.com/questions/16136519/php-rename-file-name-if-exists-append-number-to-end Original Code Any advice or guidance is greatly appreciated!

I also tried using rand () and just appended the file names, but it did not work either.

$ file_ary = array ();
$ wordpress_upload_dir = wp_upload_dir ();
$ residual_files = explode (& # 39;, & # 39 ;, $ _POST['remaining_files']);

if (isset ($ _ FILES['fileUpload']) || isset ($ _ POST['pre_files_id'])) {

$ file_count = count ($ _ FILES['fileUpload']['name']);
$ file_keys = array_keys ($ _ FILES['fileUpload']);

for ($ i = 0; $ i<$file_count; $i++) {
            foreach($file_keys as $key) {
                $file_ary[$i][$key] = $_FILES['fileUpload'][$key][$i];
            }           
        } 

        $pre_remaining_files = explode(',', $_POST['pre_files_id']);

        foreach($file_ary as $file_ary_data){

            $file_name =  $file_ary_data['name'];

            if(in_array($file_name,$remaining_files)){

                $file_tmp_name =  $file_ary_data['tmp_name'];

                $new_file_mime = @mime_content_type($file_ary_data['tmp_name']);            
                $new_file_path = $wordpress_upload_dir['path'].'/'.$file_name;

                if(move_uploaded_file($file_tmp_name, $new_file_path)) {
                    $upload_id[] = wp_insert_attachment(array(
                        'guid' => $ new_file_path,
& # 39; # 39 & post_mime_type; => $ new_file_mime,
& # 39; # 39 & post_title; => preg_replace (& # 39; / .[^.]+ $ / & # 39 ;, & # 39; & # 39 ;, $ filename),
& # 39; # 39 & POST_CONTENT; => & # 39 ;,
& # 39; # 39 & post_status; => & # 39; inherit & # 39;
), $ new_file_path);

require_once (ABSPATH. & # 39; wp-admin / includes / image.php & # 39;);
wp_update_attachment_metadata ($ upload_id, wp_generate_attachment_metadata ($ upload_id, $ new_file_path));
}
}
}

$ old_files_meta = get_post_meta ($ current_post, & # 39; _ct_files & # 39 ;, true);

/ * Post-Meta update and display in the backend post * /
if (! empty ($ upload_id)) {
for ($ a = 0; $ a <count ($ upload_id); $ a ++) {
$ arr[$upload_id[$a]]= wp_get_attachment_url ($ upload_id[$a]);

}
if (! empty ($ old_files_meta)) {
$ file_upload_id = $ old_files_meta + $ arr;
}
otherwise{
$ file_upload_id = $ arr;
}

if (! empty ($ file_upload_id)) {
update_post_meta ($ post_id, & # 39; _ct_files & # 39 ;, $ file_upload_id);
}
}
}

Interpret PDF file with PHP

I'm trying to interpret a PDF file to store the data. I tried to use the pdfparser.org and Gufy PdfToHtml libraries, but the returned data is unreadable.

Copy and paste the data returns: 2
& # 39;
(That

I also tried Google OCR, but the data is incorrect.

Example of a file: https://www.tjam.jus.br/index.php/phoca-precatorios/file/16703

Does anyone have any other options?

Custom Post Types – How to have a dynamic slug and render the archive {post_type} .php?

So I have a custom post type named network and the name company_category for the custom taxonomy. Everything is fine until I can no longer render http: // localhost / digitalhxstaging / company. Both the company category and the company are all good, with the exception of archive-network.php. I've tried to remove the dynamic slug and how it works, but now my company category and company post are not showing the correct link. Please help me. I hope that makes sense. Below is the code with post link function.

public function company_post_type () {
$ labels = array (
& # 39; name & # 39; => _x (& # 39; company & # 39 ;, company & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & singular_name; => _x (& # 39; company & # 39 ;, & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & menu_name; => _x (& # 39; companies & # 39; companies & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & name_admin_bar; => _x (& # 39; company & # 39; company & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & add_new; => __ (& # 39; Add New & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & add_new_item; => __ (& # 39; add new company & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & new_item; => __ (& # 39; New Company & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & edit_item; => __ (& # 39; edit company & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & view_item; => __ (& # 39; View Company & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & all_items; => __ (& # 39; all companies & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & search_items; => __ (& # 39; search companys & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & parent_item_colon; => __ (& # 39; parent: & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & not_found; => __ (& # 39; no company found. & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & not_found_in_trash; => __ (& # 39; No company found in Recycle Bin. & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & featured_image; => _x (& # 39; Company Cover Image & # 39 ;, & # 39; overrides the phrase & # 39; Featured Image & # 39; for this post type. Added in 4.3 & # 39; dhx-portal & & gt; # 39),
& # 39; # 39 & set_featured_image; => _x (& # 39; Define Title Picture & # 39 ;, & # 39; Overrides the phrase "Set Selected Picture" for this post type. Added in 4.3 & # 39; dhx-portal & # 39 ;,
& # 39; # 39 & remove_featured_image; => _x (& # 39; Remove Cover Image & # 39 ;, & # 39; Overrides the "Remove Selected Image" phrase for this post type. Added in 4.3 & # 39 ;, dhx-portal & # 39;
& # 39; # 39 & use_featured_image; => _x (& # 39; Use as title image & # 39 ;, & # 39; Overrides the phrase "Use as featured image" for this post type. Added in 4.3, & # 39; dhx-portal & # 39;
& # 39; # 39 & archives; => _x (& # 39; Company archives & # 39 ;, & # 39; The Post Type Archive label used in navigation menus, Default "Post Archives." Added in 4.4 & 39 ;, & # 39; dhx-portal & # 39 ),
& # 39; # 39 & insert_into_item; => _x (& # 39; Insert in company & # 39 ;, & # 39; Overrides the expression & # 39; Insert in post & # 39; / & # 39; Add in page & # 39; (when inserting media used in a post). Added in 4.4 & # 39 ;, dhx-portal & # 39 ;,
& # 39; # 39 & uploaded_to_this_item; => _x ("Uploaded to this company", "Overrides the Uploaded to this post" / "Uploaded to this page") (used when viewing attached media). Added in 4.4 & # 39 ;, dhx-portal & # 39; )
& # 39; # 39 & filter_items_list; => _x (& # 39; Filter companies list & # 39 ;, & # 39; screen reader text for the filter link header in the list of post types screen Default setting: Filter posts list / Filter pages list Added in 4.4 & # 39 ;, & # 39; dhx portal & # 39;),
& # 39; # 39 & items_list_navigation; => _x (& # 39; company list navigation & # 39 ;, & # 39; screen reader text for the pagination heading on the list of post types list. Default Posting List Navigation / Page Navigation default. Added in 4.4 & '; & # 39; dhx-portal & # 39;),
& # 39; # 39 & items_list; => _x (& # 39 ;, company list & # 39 ;, & # 39; screen reader text for the item list heading on the list of post types default setting "Post List" / "Page List" added in 4.4 & # 39, & # 39; # 39 & textdomain),
);

$ args = array (
& # 39; labels & # 39; => $ labels,
& # 39; # 39 & taxonomies; => array (& # 39; company_category & # 39;),
& # 39; public & # 39; => true,
& # 39; # 39 & publicly_queryable; => true,
& # 39; # 39 & show_ui; => true,
& # 39; # 39 & show_in_menu; => true,
& # 39; # 39 & menu_position; => 5,
& # 39; # 39 & menu_icon; => & # 39; dashicons-building & # 39 ;,
& # 39; rewrite & # 39; => array (& # 39; slug & # 39; => & # 39; company /% company_category% & # 39 ;, & # 39; with_front & # 39;;> false),
& # 39; # 39 & query_var; => true,
& # 39; # 39 & capacity_type; => & # 39; post & # 39 ;,
& # 39; # 39 & has_archive; => true,
& # 39; hierarchically & # 39; => true,
& # 39; supported & # 39; => array (& # 39; title & # 39 ;, & # 39; author & # 39 ;, custom fields & # 39;
);

register_post_type (& # 39; network & # 39 ;, $ args);
flush_rewrite_rules ();
}

/ **
* Company-specific taxonomy
* @since 0.1.0
* @access public
* /
public function company_taxonomy () {

$ labels = array (
& # 39; name & # 39; => __ (& # 39; enterprise categories & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & singular_name; => __ (& # 39; Category & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & search_items; => __ (& # 39; search categories & # 39 ;, dhx-portal & # 39;),
& # 39; # 39 & all_items; => __ (& # 39; All categories & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & parent_item; => __ (& # 39; Parent & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & parent_item_colon; => __ (& # 39; Parent: & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & edit_item; => __ (& # 39; edit category & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & update_item; => __ (& # 39; Update Category & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & add_new_item; => __ (& # 39; add new category & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & new_item_name; => __ (& # 39; new category & # 39 ;, & # 39; dhx-portal & # 39;),
& # 39; # 39 & menu_name; => __ (& # 39; Categories & # 39; dhx-portal & # 39;),
);

$ args = array (
& # 39; hierarchically & # 39; => true,
& # 39; labels & # 39; => $ labels,
& # 39; # 39 & show_ui; => true,
& # 39; # 39 & show_admin_column; => true,
& # 39; # 39 & query_var; => true,
& # 39; rewrite & # 39; => array (& # 39; slug & # 39; => & # 39; company & # 39 ;, with #front & # 39; => false),
);

register_taxonomy (& # 39; company_category & # 39 ;, array (& # 39; company_category & # 39;), $ args);
flush_rewrite_rules ();
}

/ **
* Company Permalink
* @since 0.1.0
* @access public
* /
public function company_post_link ($ post_link, $ id = 0) {
$ post = get_post ($ id);
if (is_object ($ post)) {
$ terms = wp_get_object_terms ($ post-> ID, & # 39; company_category & # 39;);
if ($ terms) {
return str_replace (& # 39;% company_category% & # 39 ;, $ terms[0]-> snail, $ post_link);
}
}
return $ post_link;
}

Here is the correct URL that works

enter Here is the correct URL that works

Let me know what you think. I only need http: // localhost / digitalhxstaging / company to work

php – wp_mail () does not work while mail () works

wp_mail () does not work while mail () is working. If the order is placed and the order confirmation email is not received, "Request Timeout" is always displayed. The processing of this request takes too long. The server has timed out. If the time limit is not exceeded, please contact the administrator of this website

I checked the core file class-phpmailer.php in WordPress.

I want a mail sent with wp_mail ()

I have increased the SMTP timeout with the following code
add_filter (& # 39; wp_mail_smtp_custom_options & # 39 ;, & # 39; smtp_timeout & # 39;);

Function smtp_timeout ($ phpmailer)
{
$ phpmailer-> Timeout = 30;
$ phpmailer-> timelimit = 60;
return $ phpmailer;
}

The problem still exists. No e-mail is sent and the timeout error is fixed.

php – How do I get this text accessible

The text of my homepage does not react, if someone can help me …

# Do you want xxxxx xxxxx in xxxxx? & # 39 ;,
Best aaa bbb tool. Just create xxxxx and xxxxx xxxxxx,
fast and safe! & # 39 ;, Xxxxx at xxx xxxxxx xxxxxxx no matter where you are. & # 39 ;,

Translation Ficherios

Translation and localization

https://slack-files.com/TJMQC7NH3-FJMNANF7C-8ea0545cd5

Translation DE

https://slack-files.com/TJMQC7NH3-FK1ACNY78-fd61f0ad57

Base

https://slack-files.com/TJMQC7NH3-FJSQVPS1F-109d8302a0

index

https://slack-files.com/TJMQC7NH3-FJSQVDPL1-d81f10938b