Compare two meta key values with between value – WordPress

Records in CPT are as follow

Name Size From Size To

Demo 1 900 6000

Demo 2 5000 6000

Demo 3 750012000

Demo 4 2500 7500

Demo 5 9000 12000

    $meta_query = array(
        'relation' => 'OR',
        array(
            array(
                'key' => '_size',
                'value'    =>  array(1000, 5000),
                'type'     => 'decimal(10, 2)',
                'compare'  => 'between'
            ),
            array(
                'key' => '_size_to',
                'value'    =>  array(1000, 5000),
                'type'     => 'decimal(10, 2)',
                'compare'  => 'between'
            ),
        ),
    );

After applying above meta_query not able to get actual output

Expected Output
Name Size From Size To

Demo 1 900 6000

Demo 2 5000 6000

Demo 4 2500 7500

Actually it’s working like below SQL’s. Please review once and let me know best fit for this situation.

Right Now

SELECT * FROM test WEHRE _size BETWEEN (1000 AND 5000) OR _size_to BETWEEN (1000 AND 5000)

Trying to do like below

SELECT * FROM test WEHRE 1000 BETWEEN (_size AND _size_to) OR 5000 BETWEEN (_size AND _size_to)

Foreign characters cuts up words with Smalot PdfParser getText()

I’m trying to extract the text from a PDF using Smalot PdfParser.

$parser = new SmalotPdfParserParser();
$pdf = $parser->parseFile(myfile);
$text = $pdf->getText();

It works fine, except foreign characters (like æ ø å ü ẞ) seems to cut words up. A word like “Banegård” will give the words “Baneg” and “rd”, and the å character is gone.
This is from very simple PDF files that was written with LibreOffice Writer default settings. So nothing fancy.

I’m a bit surprised that Googling gives me nothing. Surely this is a fairly straight forward thing here in 2024? What am I missing?

How to Update Textarea Values in Filament Component with JavaScript?

i want to update the value of textarea with java script but when i submit the words i can only get data that users typed directly inside textarea and not changes by javascript
what should i do?
here is my code:

Translate::make()
                        ->locales(['fa', 'en'])
                        ->columnSpanFull()
                        ->columns(2)
                        ->schema(fn (string $locale) => [
                            FormsComponentsSelect::make('variables')
                                ->extraAttributes([
                                    'onchange' => 'insertToTextarea("'.$locale.'")'
                                ])
                                ->options(NotificationTemplateVariableEnums::class),
                            FormsComponentsTextarea::make('template')
                                ->required()
                                ->columnSpanFull()
                                ->reactive(),
                        ])

// javascript

function insertToTextarea(locale) {
const textarea = document.getElementById('data.template.'+locale+'');
const variable = document.getElementById('data.variables.'+locale+'').value;
if (!textarea) return;


const start = textarea.selectionStart;
const end = textarea.selectionEnd;

const value = textarea.value;
textarea.value = value.slice(0, start) + variable + value.slice(end);

textarea.selectionStart = textarea.selectionEnd = start + variable.length;


textarea.focus();

}

protected function mutateFormDataBeforeSave(array $data): array
{dd($data);
}

WordPress disable Notice and Deprecated in debug.log

I want to get rid of Notice and Deprecated errors in my debug.log

here is my wp-config.php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

mu-plugins/error-reporting.php
// Disable notices, warnings, deprecated, and strict errors globally

error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED & ~E_USER_DEPRECATED & ~E_STRICT);

// Ensure that display_errors is turned off

ini_set('display_errors', 0);
ini_set('log_errors', 1); // Enable logging of errors to error log

in php.ini

I have Master value error_reporting = 6133
but local value is 8181

How can I override it and make sure plugins won’t override it again?

I tried to change it inside php.ini / wp-config.php / mu-plugin, but it’s still doesn’t work and I’m getting Notices in my debug.log

yii2 why are buttons rendered outside bootstrap modal

<?php
    $yesBtn = Html::submitButton('yes', ['class' => 'btn btn-primary']);
    $noBtn = Html::submitButton('no', ['class' => 'btn btn-secondary']);

    $modal = Modal::begin([
// ...
'footer' => "$noBtn $yesBtn"
    ]);

echo "are you sure?";

    Modal::end();

    echo $modal->run();

I have the above code to render a modal, and have 2 buttons (yesBtn, noBtn) shown on it, but both buttons are rendered outside the modal too (at the bottom of the page, even before clicking the modal’s toggleButton), where i don’t want them.

Why does adding the buttons to the footer render them outside the modal?
Is there a better way to achieve what i’m trying to do?

How to Customize Header and Footer with Elementor in a Theme Without Site Editor Support

Problem:

I’m using a custom theme that doesn’t support the WordPress Site Editor. I want to create a new splash page with a modified header and footer that hides the nav menu. Elementor is enabled.

Question:

How can I use Elementor to edit the existing header and footer templates from my theme and conditionally hide the nav menu for the splash page?

Additional Details:

Theme: custom_theme
Elementor Version: 3.23.4
WordPress Version: 6.5.5

How to get all touched files/classes during the response generation

I’ve used autoload but it’s not giving all the files/classes that’s been used during request

spl_autoload_register(function ($class) {
    $logFile = __DIR__ . '/autoload_log.txt';
    $message = $class . "n";
    file_put_contents($logFile, $message, FILE_APPEND);
}, true, true);

Is there any other way to trace all classes that’s been involved during the page generation?

How to disable product title hyperlink in wooCommerce

I would like to develop wooCommerce custom plugin. For the project requirement product title hyperlink will be disable.For this simple task i define the following script.Please give me the solution How to fix this.I want to use it WordPress custom plugin.

class Custom_WooCommerce_Disable_Title_Link {
    public function __construct() {
        add_action( 'init', array( $this, 'remove_title_hyperlink' ) );
    }

    public function remove_title_hyperlink() {

        remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
        remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    }
}

new Custom_WooCommerce_Disable_Title_Link();

I tried about above script. this is doesn’t work

How to implement a different header on each page with WordPress Waymore theme?

I am using the waymore theme of popularfx in WordPress and want to change the header image in my About and Service page.

Currently, the same header image is showing on all pages, but I want a different header banner on my About and Service page

I created header-about.php at wp-content/theme/popularfx/header-about.php

and changed code in page.php

<?php
    if(is_page('about'))
    {
       get_header('about');
    }
   else
   {
       get_header();
   }
  wp_head();
?>

but this code is not working at all.

I also tried different plugins for same unique header, wp header images etc

Laravel Powergrid Table Add Loading on Pagination

I’m fairly new to Laravel, and I’m using PowerGrid to display an employee table. The skeleton loading works fine when the page initially loads, but I would like to add the loading animation when changing the “per page” value or switching between pages.

The PowerGrid component:

final class PowergridTable extends PowerGridComponent
{
    use TableTraits;

    public bool $deferLoading = true;
    public string $loadingComponent = 'components.table-loading';

    public string $sortField = 'created_at';
    public string $sortDirection = 'desc';

    public $year;
    public $month;

    public function setUp(): array
    {
        $this->year = now()->year;
        $this->month = now()->month;

        return [
            Footer::make()
                ->showPerPage()
                ->showRecordCount(),
        ];
    }

    public function datasource(): Builder
    {
        $employees = Employee::query()
            ->select([
                'employees.id as emp_id',
                'employees.first_name',
                'employees.last_name',
            ]);

        return $employees;
    }

    public function relationSearch(): array
    {
        return [];
    }

    public function fields(): PowerGridFields
    {
        $startIndex = $this->paginationStartIndex();

        return PowerGrid::fields()
            ->add('index', fn (Employee $model, $index) => ++$index + $startIndex)
            ->add('company_id', fn (Employee $model) => $model->company_id);
    }

    public function columns(): array
    {
        return [
            Column::make('#', 'index'),
            Column::make(__("main.salary.table.employee"), 'employee_name', 'last_name')
                ->headerAttribute('w-[250px] overflow-hidden whitespace-nowrap')
                ->sortable(),
        ];
    }

    public function filters(): array
    {
        return [
            Filter::inputText('employee_name', 'employees.id')
                ->operators(['contains']),
        ];
    }

    #[LivewireAttributesOn('edit')]
    public function edit($rowId): void
    {
        $this->js('alert(' . $rowId . ')');
    }

    #[On('filter-dates')]
    public function filterSalary($val)
    {
        $data = explode("-", $val);
        $this->year = $data[0];
        $this->month = $data[1];
    }
}
       

The loading component (table-loading.blade.php)

<div class="p-2 space-y-4 animate-pulse">
    {{-- # Column --}}
    <div class="flex items-center gap-4">
        @for ($i = 0; $i < 10; $i++)
            {{-- # Row --}}
            <div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-40 mb-2.5"></div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-48 mb-2.5"></div>
            </div>
        @endfor
    </div>
    {{-- # Column --}}
    <div class="flex items-center gap-4">
        @for ($i = 0; $i < 10; $i++)
            {{-- # Row --}}
            <div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-40 mb-2.5"></div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-48 mb-2.5"></div>
            </div>
        @endfor
    </div>
    {{-- # Column --}}
    <div class="flex items-center gap-4">
        @for ($i = 0; $i < 10; $i++)
            {{-- # Row --}}
            <div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-40 mb-2.5"></div>
                <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-48 mb-2.5"></div>
            </div>
        @endfor
    </div>
</div>

To implement the loading skeleton, I tried using wire:loading on the table-loading component like this:

<div wire:loading wire:target='perPage'>
    <div class="p-2 space-y-4 animate-pulse">
        @for ($i = 0; $i < 10; $i++)
            <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-40 mb-2.5"></div>
            <div class="h-2.5 bg-gray-300 rounded-full dark:bg-neutral-500 w-48 mb-2.5"></div>
        @endfor
    </div>
</div>

However, it doesn’t seem to work as expected when changing the “per page” value or switching between pages. The loading skeleton doesn’t appear during those events.

Is there a proper way to add loading animations for page changes or “per page” value changes in PowerGrid?

XAMPP, Microsoft PHP Drivers for SQL Server Support: cannot find the extensions

I’m having a problem setting up a server using XAMPP.
After setting up everything, PHP throws an error saying that Call to undefined function sqlsrv_connect(), after some more troubleshooting I found out that PHP couldn’t find the extensions. My PHP version is 8.0.3 (BTW when I ran php --version I got this:

PHP Warning:  PHP Startup: Unable to load dynamic library 'php_sqlsrv_83_ts_x64' (tried: C:xamppphpextphp_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:xamppphpextphp_php_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_sqlsrv_83_ts_x64' (tried: C:xamppphpextphp_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:xamppphpextphp_php_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_83_ts_x64' (tried: C:xamppphpextphp_pdo_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:xamppphpextphp_php_pdo_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'php_pdo_sqlsrv_83_ts_x64' (tried: C:xamppphpextphp_pdo_sqlsrv_83_ts_x64 (Impossibile trovare la procedura specificata), C:xamppphpextphp_php_pdo_sqlsrv_83_ts_x64.dll (Impossibile trovare il modulo specificato)) in Unknown on line 0
PHP 8.0.30 (cli) (built: Sep  1 2023 14:15:38) ( ZTS Visual C++ 2019 x64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies

The extensions are there:

As well as activated in the right php.ini file:

enter image description here

My extension dir:

extension_dir="C:xamppphpext"

PHP Show MySQL Search result must contain exact keywords but in any order [duplicate]

I am using this php code for MySQL database query:

function search_it() {
    if ( isset( $_GET['s'] ) ) {
        global $wpdb;
        $address_table = $wpdb->prefix . 'my_products';
        $search = $_GET['s'];
    $search = trim($search);         
    $keywords = explode(" ", $search);     
    foreach($keywords as $search) {
        $search = "%{$search}%";
        $where = $wpdb->prepare( 'WHERE name LIKE %s OR price LIKE %d OR id LIKE %d OR market_price LIKE %d OR image_url LIKE %s LIMIT 0,30' , $search, $search, $search, $search, $search );
        }   
    $results = $wpdb->get_results( "SELECT * FROM {$address_table} {$where}" );
        return $results;
    }} 

for example my database have these lines

This is a blue car
This is a white car
This is a red car
This car color is blue
This is a yellow car
This is a blue bike
This car name is bluebird
Blue car looks awesome
       

When i execute the above code, with query blue car
then it will show me all results which contain CAR and all results which contain BLUE
But i want it show me the only results which contain keyword BLUE and CAR even these keywords are saved in any order in database

I want it show me only these results, when i search for blue car

This is a blue car 
This car color is blue
This car name is bluebird
Blue car looks awesome

Above keywords are just for example it would any

WordPress redirect not working for custom post type

I’m building a WordPress site, with two nested custom post types, but I’m experiencing an error. I’m hoping to achieve the following basic structure:

  1. https://website.com/news/ –> shows me my regular wordpress posts
  2. https://website.com/events/ –> shows me custom events listing, my custom type of ‘events’
  3. https://website.com/events/an-event/ –> an example event
  4. https://website.com/events/an-event/ride-01/ –> shows me custom ‘rides’ post type instance

I achieve (1.) on Settings > Permalinks > Custom Structure: /news/%postname%/ – it’s working fine.

I achieve the rest with a custom plugin, code below.

(2.) is working fine.
(3.) is working fine.

My problem is with (4.) – I’m able to create rides, and in the admin panel everything looks fine, even the link to view them. However, when I go to view the post, for example at ‘https://website.com/events/an-event/ride-01/’ I get a 404 error. It looks to me like this should be handled by this line, but isn’t:

add_rewrite_rule( '^/events/([^/]+)/([^/]+)/?$','/index.php?rides=$matches[2]','top' );

When I view https://website.com/index.php?rides=ride-01 I can see my ‘ride’ ok.

How can I view rides with my desired URL as per (4.)? I’ve tried numerous configurations of the ‘rewrite’ and ‘hierarchy’ options but can’t seem to get it to work.

It’s worth noting, every time I make a change I restart my webserver and save the permalinks page to clear any caches.

Thanks!

<?php

/*
Plugin Name: Etc etc.
*/

if (!defined('ABSPATH')) {
    exit; // Exit if accessed directly.
}

function fun_be_post_type()
{
    $labels = array(
        'name'               => _x('Events', 'post type general name'),
        'singular_name'      => _x('Event', 'post type singular name'),
        'add_new'            => _x('Add New', 'track'),
        'add_new_item'       => __('Add New Event'),
        'edit_item'          => __('Edit Event'),
        'new_item'           => __('New Event'),
        'all_items'          => __('All Events'),
        'view_item'          => __('View Event'),
        'search_items'       => __('Search Events'),
        'not_found'          => __('No events found'),
        'not_found_in_trash' => __('No events found in the Trash'),
        'menu_name'          => 'Events'
    );
    $args = array(
        'labels'        => $labels,
        'rewrite' => array(
            'slug' => 'events', // This controls the base slug that will display before each term
            'with_front' => false // Don't display the category base before "/locations/"
        ),
        'hierarchical' => true,
        'description'   => 'Holds our bike events and event-specific data',
        'public'        => true,
        'publicly_queryable' => true,
        'show_in_rest'  => true,
        'query_var'     => true,
        'capability_type'    => 'post',
        'map_meta_cap' => true,

        'rest_controller_class' => 'WP_REST_Posts_Controller',
        'menu_position' => 5,
        'menu_icon'     => 'data:image/svg+xml;base64,PHN2ZyB3etc...+', // base64 encoded svg menu icon
        'supports'      => array('title', 'editor', 'thumbnail', 'excerpt', 'comments', 'revisions', 'custom-fields'),
        'has_archive'   => true,
        'autop'         => false
    );
    register_post_type('events', $args);

    $labels = array(
        "name" => "Rides",
        "singular_name" => "Ride",
    );

    $args = array(
        "labels" => $labels,
        "description" => "",
        "public" => true,
        "show_ui" => true,
        "has_archive" => true,
        "show_in_menu" => true,
        'menu_position' => 6,
        //'with_front' => false,
        "exclude_from_search" => false,
        "capability_type" => "post",
        "map_meta_cap" => true,
        'hierarchical' => false,
        "rewrite" => array("slug" => "events/%event%", "with_front" => false),
        "query_var" => true,
        "supports" => array("title", "revisions", "thumbnail")
    );

    register_post_type("rides", $args);
}
add_action('init', 'fun_be_post_type');


add_action('add_meta_boxes', function () {
    add_meta_box('rides-parent', 'Events', 'rides_attributes_meta_box', 'rides', 'side', 'default');
});

function rides_attributes_meta_box($post)
{
    $pages = wp_dropdown_pages(array('post_type' => 'events', 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)'), 'sort_column' => 'menu_order, post_title', 'echo' => 0));
    if (! empty($pages)) {
        echo $pages;
    } // end empty pages check
}

add_action('init', function () {

    add_rewrite_rule('^/events/([^/]+)/([^/]+)/?$', '/index.php?rides=$matches[2]', 'top');
});

add_filter('post_type_link', function ($link, $post) {
    if ('rides' == get_post_type($post)) {
        //Lets go to get the parent cartoon-series name
        if ($post->post_parent) {
            $parent = get_post($post->post_parent);
            if (!empty($parent->post_name)) {
                return str_replace('%event%', $parent->post_name, $link);
            }
        } else {
            //to add later
        }
    }
    return $link;
}, 10, 2);

add_filter('manage_rides_posts_columns', 'set_custom_edit_br_columns');

function set_custom_edit_br_columns($columns)
{
    $columns['br_highlight'] = __('Strava ID', 'bike-ride');

    $columns = array(
        'cb' => $columns['cb'],
        'title' => __('Title'),
        'parent_id' => __('Event'),
        'date' => __('Date'),
    );

    return $columns;
}

add_action('manage_rides_posts_custom_column', 'custom_br_column', 10, 2);
function custom_br_column($column, $post_id)
{
    switch ($column) {

        case 'parent_id':
            $post_parent = get_post_parent($post_id);
            $parent_title = get_the_title($post_parent);
            $parent_view_link = get_permalink($post_parent);
            $parent_edit_link = get_edit_post_link($post_parent);
            echo ("
      <a class='row' href='" . $parent_edit_link . "' aria-label='" . $parent_title . " (Edit)'>" . $parent_title . "</a>
      
      <div class='row-actions'><span class='edit'><a href='" . $parent_edit_link . "' aria-label='Edit “" . $parent_title . "”'>Edit</a> | </span><span class='view'><a href='" . $parent_view_link . "' rel='bookmark' aria-label='View “" . $parent_title . "”'>View</a></span></div>
    ");
            break;
    }
}

AJAX mistake make 500 error after insert to database table [duplicate]

im newbie, i have 500 error, when i wanna send new information in DB.

<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible">
    <title>WEB ID</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],100..900&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div class="change-light">
    <button>Press to <span>Light</span></button>
</div>
<div class="form-block light">
    <div class="header">
        <h1>Создание WEB ID</h1>
        <div class="desc-block">
            <div class="desc">Уже есть WEB ID?</div>
            <a href="#">Найти его здесь ></a>
        </div>
    </div>
    <form>
        <div class="block">
            <input type="text" id="name" placeholder="Имя">
        </div>
        <div class="block">
            <input type="text" id="surname" placeholder="Фамилия">
        </div>
        <div class="hr"></div>
        <div class="block">
            <input type="text" id="dateofbirth" placeholder="Дата рождения">
        </div>
        <div class="block">
            <select name="country" id="country">
                <option value="">Страна</option>
                <option value="Russia">Россия</option>
                <option value="Canada">Канада</option>
            </select>
        </div>
        <div class="block">
            <input type="text" id="email" placeholder="Почта">
        </div>
        <div class="hr"></div>
        <div class="block">
            <input type="password" id="password" placeholder="Пароль">
        </div>
        <div class="block">
            <input type="password" id="repeat_password" placeholder="Повторите пароль">
        </div>
        <div class="errors-block">
            <p></p>
        </div>
        <input type="submit" value="Продолжить">
    </form>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="main.js"></script>
</body>
</html>
$('document').ready(function () {
    let register_form = $('.form-block form');
    register_form.on('submit', function (event) {
        event.preventDefault();
        let name = $('#name').val();
        let surname = $('#surname').val();
        let dateofbirth = $('#dateofbirth').val();
        let country = $('#country').val();
        let email = $('#email').val();
        let password = $('#password').val();
        let repeat_password = $('#repeat_password').val();
        let email_mask = /^[w-.]+@[w-]+.[a-z]{2,4}$/i;
        let date_mask = /d{1,2}/d{1,2}/d{2,4}/;

        let noErrors = true;

        $('.error').remove();
        $('.errored').removeClass('errored');

        if (name.length < 1) {
            $('#name').parent().addClass('errored');
            $('#name').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }
        if (surname.length < 1) {
            $('#surname').parent().addClass('errored');
            $('#surname').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }
        if (dateofbirth.length < 1 || !date_mask.test(dateofbirth)) {
            $('#dateofbirth').parent().addClass('errored');
            $('#dateofbirth').after('<div class="error"><span>Заполните это поле в формате **/**/****</span></div>');
            noErrors = false;
        }
        if (country.length < 1) {
            $('#country').parent().addClass('errored');
            $('#country').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }
        if (email.length < 1 || !email_mask.test(email)) {
            $('#email').parent().addClass('errored');
            $('#email').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }
        if (password.length < 1) {
            $('#password').parent().addClass('errored');
            $('#password').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }
        if (repeat_password.length < 1 || password !== repeat_password) {
            $('#repeat_password').parent().addClass('errored');
            $('#repeat_password').after('<div class="error"><span>Заполните это поле</span></div>');
            noErrors = false;
        }

        if (noErrors) {
            $.ajax({
                url: 'new_registration.php',
                method: 'POST',
                dataType: 'html',
                data: {
                    "name": name,
                    "surname": surname,
                    "dateofbirth": dateofbirth,
                    "country": country,
                    "email": email,
                    "password": password,
                    "repeat_password": repeat_password
                },
                success: function (data) {
                    console.log('DONE');
                    register_form.trigger('reset');
<?php
$servename = "localhost";
$user = "anar";
$password = "anar";
$database = "webid";

$connection = mysqli_connect($servename,$user,$password,$database);
mysqli_set_charset($connection, "utf8");
if($connection->connect_error){
    die("Ошибка подключения: " . $connection->connect_error);
}
<?php
include 'config.php';

$msg_box = "";
$errors = array();

$name = $_POST['name'];
$surname = $_POST['surname'];
$dateofbirth = $_POST['dateofbirth'];
$country = $_POST['country'];
$email = $_POST['email'];

if ($name = "") $errors[] = "Поле имени не заполнено";
if ($surname = "") $errors[] = "Поле фамилии не заполнено";
if ($dateofbirth = "") $errors[] = "Поле даты не заполнено";
if ($country = "") $errors[] = "Поле страны не заполнено";
if (($email == "") || (filter_var($email, FILTER_VALIDATE_EMAIL) == false)) {
    $errors[] = "Поле email не заполнено!";
}

if ($password = "") $errors[] = "Поле пароля не заполнено";
if ($repeat_password = "") $errors[] = "Поле повтора пароля не заполнено";
if ($password !== $repeat_password) {
    $errors[] = "Пароли не совпадают";
} else {
    $password = password_hash($_POST['password'], PASSWORD_DEFAULT);
}

if (empty($errors)) {
    $stmt = mysqli_prepare($connection, "INSERT INTO users (name, surname, dateofbirth, country, email, password) VALUES (?, ?, ?, ?, ?, ?)");

    mysqli_stmt_bind_param($stmt, "ssssss", $name, $surname, $dateofbirth, $country, $email, $password);

    mysqli_stmt_execute($stmt);
} else {
    echo "есть ошибка";
}


$connection->close();

When i make select * from users – it works right. i wanna create a new user in users via registration form.
console saying Failed to load resource: the server responded with a status of 500 (Internal Server Error) i have problem here:

try {
    r.send(i.hasContent && i.data || null)
} catch (e) {
    if (o)
        throw e
}

Microsoft Graph API PHP ODataError line 36 with no exception message when trying to use filter

I have installed and executed the basic example for MS Graph API through the PHP SDK. The examples contain a class named GraphHelper, which has a method getInbox:

public static function getInbox(): ModelsMessageCollectionResponse {
        $configuration = new MessagesRequestBuilderGetRequestConfiguration();
        $configuration->queryParameters = new MessagesRequestBuilderGetQueryParameters();
        // Only request specific properties
        $configuration->queryParameters->select = ['from','isRead','receivedDateTime','subject'];

        $configuration->queryParameters->filter = "(from/emailAddress/address) eq '[email protected]'";

        // Sort by received time, newest first
        $configuration->queryParameters->orderby = ['receivedDateTime DESC'];
        // Get at most 25 results
        $configuration->queryParameters->top = 25;
        return GraphHelper::$userClient->me()
            ->mailFolders()
            ->byMailFolderId('inbox')
            ->messages()
            ->get($configuration)->wait();
    }

If I omit the line $configuration->queryParameters->filter = "(from/emailAddress/address) eq '[email protected]'";, I get the 25 latest messages from my inbox. When I apply filter, no matter what filter I put, I get the following:

Error getting user's inbox: 

MicrosoftGraphGeneratedModelsODataErrorsODataError in /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/microsoft-graph/src/Generated/Models/ODataErrors/ODataError.php:36
Stack trace:
#0 /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/kiota-serialization-json/src/JsonParseNode.php(117): MicrosoftGraphGeneratedModelsODataErrorsODataError::createFromDiscriminatorValue()
#1 /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/kiota-http-guzzle/src/GuzzleRequestAdapter.php(678): MicrosoftKiotaSerializationJsonJsonParseNode->getObjectValue()
#2 /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/kiota-http-guzzle/src/GuzzleRequestAdapter.php(160): MicrosoftKiotaHttpGuzzleRequestAdapter->throwFailedResponse()
#3 /home/alexios/research/automation/finances/automation-finances-import/vendor/php-http/promise/src/FulfilledPromise.php(39): MicrosoftKiotaHttpGuzzleRequestAdapter->MicrosoftKiotaHttp{closure}()
#4 /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/kiota-http-guzzle/src/GuzzleRequestAdapter.php(145): HttpPromiseFulfilledPromise->then()
#5 /home/alexios/research/automation/finances/automation-finances-import/vendor/microsoft/microsoft-graph/src/Generated/Users/Item/MailFolders/Item/Messages/MessagesRequestBuilder.php(73): MicrosoftKiotaHttpGuzzleRequestAdapter->sendAsync()
#6 /home/alexios/research/automation/finances/automation-finances-import/src/Microsoft/GraphHelper.php(80): MicrosoftGraphGeneratedUsersItemMailFoldersItemMessagesMessagesRequestBuilder->get()
#7 /home/alexios/research/automation/finances/automation-finances-import/bin/import.php(25): AlexiosTsiaparasAutomationFinancesImportMicrosoftGraphHelper::getInbox()
#8 /home/alexios/research/automation/finances/automation-finances-import/bin/import.php(85): listInbox()
#9 {main}

So, no error description whatsoever.

I got the filtering from https://learn.microsoft.com/en-us/graph/use-the-api#query-parameters, and checked out the Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer.

The get my mails from an address example has the filter I am interested in:

https://graph.microsoft.com/v1.0/me/messages?$filter=%28from%2FemailAddress%2Faddress%29+eq+%27MiriamG%40M365x214355.onmicrosoft.com%27

I tried url encoding the filter, and not, the error remains the same.

Update

I tried to bypass the SDK, except for the access token, so I did the following:

$accessToken = GraphHelper::getUserToken();
// echo "Token: $tokenn";

$params = [
    'select' => ['from','isRead','receivedDateTime','subject'],
    'orderby' => ['receivedDateTime DESC'],
    'top' => 3,
    'filter' => "(from/emailAddress/address) eq '[email protected]'"
];

$ch = curl_init();
$url = 'https://graph.microsoft.com/v1.0/me/messages?'.http_build_query($params);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer " . $accessToken));
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err = curl_error($ch);
curl_close($ch);

echo "HTTP status: $httpcodenError:n";
print_r($err);
echo "nOutputn------n";
echo $output;

Everything works and I manage to get a response back with expected results!