Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn’t exist)

i’m trying parse(scrape) the website, and this is my code:

<?php
    ini_set('display_errors', 1);
    require_once 'vendor/autoload.php';
    
    use FacebookWebDriverRemote{DesiredCapabilities, RemoteWebDriver};
    use FacebookWebDriverWebDriverBy;
    use FacebookWebDriverWebDriverExpectedCondition;
    use FacebookWebDriverExceptionNoSuchElementException;
    use FacebookWebDriverExceptionTimeOutException;
    
    // Set up ChromeDriver options
    $options = new FacebookWebDriverChromeChromeOptions();
    $options->setBinary('/usr/bin/chromium-browser'); // Update with the correct path
    
    $options->addArguments(['--headless']); // Run ChromeDriver in headless mode (optional)
    
    // Start ChromeDriver with the desired capabilities
    $capabilities = DesiredCapabilities::chrome();
    $capabilities->setCapability(FacebookWebDriverChromeChromeOptions::CAPABILITY, $options);
    
    // Create a new instance of RemoteWebDriver with increased timeout
   $driver = RemoteWebDriver::create('http://<vps-ip>:9516/', $capabilities, 60000, '/usr/bin/chromedriver');
    
    // Navigate to the desired website
    $driver->get('<url-for-parsing>');
    
    try {
        // Wait until the element is visible
        $wait = new FacebookWebDriverWebDriverWait($driver, 30);
        $element = $wait->until(
            WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::xpath('//div[contains(@data-testid, "profile-snippet-name")]'))
        );
    
        // Extract the text content of the div element
        $divText = $element->getText();
    
        // Print the extracted text
        echo $divText;
    } catch (NoSuchElementException $e) {
        echo "Element not found: " . $e->getMessage();
    } catch (TimeOutException $e) {
        echo "Timed out waiting for element: " . $e->getMessage();
    } finally {
        // Quit the driver
        $driver->quit();
    }
?>

and i’m getting this error:

Fatal error: Uncaught FacebookWebDriverExceptionUnknownServerException: unknown error: 
Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't
exist) (The process started from chrome location /usr/bin/chromium-browser is no longer 
running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: 
chromedriver=114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-
heads/5735@{#1052}),platform=Linux 5.15.0-75-generic x86_64) in 
/home/k/user/user.domain/public_html/app/Http/Controllers/getName/vendor/facebook/webdriver/
lib/Exception/WebDriverException.php:121 Stack trace: #0 
/home/kuser/user.domain/public_html/app/Http/Controllers/getName/vendor/facebook/webdriver/l
ib/Remote/HttpCommandExecutor.php(353): 
FacebookWebDriverExceptionWebDriverException::throwException(13, 'unknown error: ...', 
Array) #1 
/home/k/user/user.domain/public_html/app/Http/Controllers/getName/vendor/facebook/webdriver/
lib/Remote/RemoteWebDriver.php(100): FacebookWebDriverRemoteHttpCommandExecutor-
>execute(Object(FacebookWebDriverRemoteWebDriverCommand)) #2 
/home/k/user/user.domain/public_html/app/Http/Controllers/getName/index.php(22): 
FacebookWebDriverRemoteRemoteWebDriver::create('http://<vps-ip>', Array, 60000, 
'/usr/bin/chrome...') #3 {main} thrown in 
/home/k/user/user.domain/public_html/app/Http/Controllers/getName/vendor/facebook/webdriver/
lib/Exception/WebDriverException.php on line 121

Note

  • i tried this code on my pc(localhost) it worked, but when i try it on hosting it didn’t work and i got VPS (ubuntu) server and I installed chromium(also google-chrome) browser and chromedriver. I’ m trying to use it but i’m getting this error.

  • All paths (like: /usr/bin/chromedriver) are given correctly

  • the codes that i showed are not localted in vpsm they are located in hosting

  • it’s the 1st time i’m using chromedriver in php, so please answer detailed

what am i getting when i run chromedriver

root@**:~# chromedriver --port=9516 --whitelisted-ips=""
Starting ChromeDriver 114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052}) on port 9516
All remote connections are allowed. Use an allowlist instead!
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

PHP: Passing POST data to an iFrame within same file [closed]

Please I need help to unblock this problem.

So I have a large form with multiple steps, within the same file. The fourth step of this form has an iFrame that I intend to use to generate a pdf invoice.

The problem here is I am unable to to pass POST data to this invoice (in the iFrame) that requires the organization name, address, etc.

Note: I implemented JQuery/Ajax to preventDefault and parse POST to a different action php page.

Thanks

Pass POST data to iFrame within same page.

I want to add WordPress to my PHP website

I have a wordpress website with URL www.kingsdelight.org I just created an index.php which I want to be the home page of my website. I changed the WorldPress index.php fill my Cpanel root folder to index-wp.php so that my php index.php can be displaced as the home page.

Now all the wordpress pages are not loading. What should I do make both my php index.php and wordpress pages to load. I want be using the WordPress to write regular contents.

I will apprecaite your utgent help.

I have tried loadin the site WordPress pages but they are not working.

My php code for multiple choice quiz app is not working

This is my php code

<?php
include 'config.php';


$sql = "SELECT * FROM quiz where lesson = 5 order by rand() limit 20";
$result = mysqli_query($conn, $sql);



$quizQuestions = mysqli_fetch_all($result, MYSQLI_ASSOC);

// Check if the form is submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $score = 0;

    // Get the selected answer for the current question
    $selectedAnswer = isset($_POST['answer']) ? $_POST['answer'] : -1;



    // Check if the selected answer is correct
    $currentQuestion = isset($_POST['currentQuestion']) ? $_POST['currentQuestion'] : 0;
    $correctAnswer = $quizQuestions[$currentQuestion]['answer'];

    if( $selectedAnswer == $correctAnswer){
        $score++;
    }

    // Check if there are more questions
    if ($currentQuestion < count($quizQuestions) - 1) {
        // Display the next question
        displayQuestion($currentQuestion + 1, $score);
    } else {
        // Display the final score
        echo "Your score: $score out of " . count($quizQuestions);
    }
} else {
    // Display the first question
    displayQuestion(0);
}

// Function to display a question
function displayQuestion($index, $score=0)
{
    global $quizQuestions;

    $question = $quizQuestions[$index]['question'];
    $choices = array(
        $quizQuestions[$index]['option_A'],
        $quizQuestions[$index]['option_B'],
        $quizQuestions[$index]['option_C'],
        $quizQuestions[$index]['option_D']
    );

    echo '<div>';

    echo '<form method="post">';
    echo '<h3>' . $question . '</h3>';

    foreach ($choices as $choiceIndex => $choice) {
        echo '<label><input type="radio" name="answer" value="' . $choiceIndex . '">' . $choice . '</label><br>';
    }

    echo '<br>';
    echo '<input type="hidden" name="currentQuestion" value="' . $index . '">';
    echo '<input type="submit" class="next" value="Next">';
    echo '</form>';

    echo '<br>';
    echo 'Score: ' . $score . ' out of ' . ($index + 1);
    echo '</div>';
}

// Close the connection
mysqli_close($conn);
?>

I am working on multiple choice quiz application using php. The data is retrieved successfully from the database and displaying the questions one by one as well but if the answer is correct then also it is showing final answer as 0. Can any one please help me to tackle the problem?

WooCommerce add order status button in the front end to change status to received

We added a custom order status called received. For that we add a custom code to define that new custom order status “wc-received”. Now I want to create a button which I can display on the my account page in order that the customer can define if he received the order. If he click on that button, the order status should be changed to received.

For that I want to use this hook: “custom_order_after_order_status”

For that I use that snippet but it does not work at all. What I’m doing wrong here?

/**
 * Add a custom button to change order status to received
 */

add_action('custom_order_after_order_status', 'add_custom_order_button', 10, 1);
function add_custom_order_button($order)
{
    $order_id = $order->get_id();
    $order_status = $order->get_status();

    // Display the button only for orders with a status other than 'Completed'
    if ($order_status !== 'received') {
        echo '<button type="button" class="button mark-as-received" data-order-id="' . $order_id . '">Mark as received</button>';
    }
}

/**
 * Process the order status change on button click
 */
add_action('wp_ajax_mark_order_as_received', 'mark_order_as_received');
add_action('wp_ajax_nopriv_mark_order_as_received', 'mark_order_as_received');
function mark_order_as_received()
{
    if (isset($_POST['order_id']) && !empty($_POST['order_id'])) {
        $order_id = sanitize_text_field($_POST['order_id']);

        // Update the order status to 'received'
        $order = wc_get_order($order_id);
        $order->update_status('received');

        wp_send_json_success('Order status changed to received.');
    } else {
        wp_send_json_error('Invalid order ID.');
    }
}

no open page by htaccess

in MVC i got error to open index.php :
Failed to open stream: No such file or directory in C:xampphtdocsuncoxFrameworkMVCindex.php

.htaccess code:

Options -Indexes
RewriteEngine On
RewriteBase /uncoxFrameworkMVC/

RewriteCond %{REQUEST_URI} !.{jpg|png|css|js|webp|ttf|}$
RewriteRule .*  index.php [L]

index.php code:

require_once('/Config/main.php');

main.php code:

session_start();
require_once("/config.php");
require_once("/Config/db.php");
require_once("/Config/common.php");

My Directory:

enter image description here

JSON Data saving problem in MYSQL via php [duplicate]

Error :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘”docrefno”:1, “maindatakey”:”x001592″, “maindata”: { ‘ at line 3

{
    "docrefno":1,
    "maindatakey":"x001592",
    "maindata": {
                    "outdata":["outside1","outside2","outside3","outside4"],
                    "prmdata":{
                                "billno":"bl-2023/01",
                                "billdate":"01/12/2020"
                              },
                    "datapart1":{
                                    "customerid":"cust01",
                                    "gststate":"west bengal",
                                    "gstrate":28
                                },
                    "datapart2":[
                                    {"datakey":"prod01","tprodcode":"prod01","quantity":10,"rate":20,"amount":200,"discountprcn":10,"discamt":20},
                                    {"datakey":"prod02","tprodcode":"prod02","quantity":20,"rate":30,"amount":600,"discountprcn":10,"discamt":60},
                                    {"datakey":"prod03","tprodcode":"prod03","quantity":30,"rate":40,"amount":1200,"discountprcn":10,"discamt":120},
                                    {"datakey":"prod04","tprodcode":"prod04","quantity":40,"rate":50,"amount":2000,"discountprcn":10,"discamt":200},
                                    {"datakey":"prod05","tprodcode":"prod05","quantity":50,"rate":60,"amount":3000,"discountprcn":10,"discamt":300},
                                    {"datakey":"prod06","tprodcode":"prod06","quantity":60,"rate":70,"amount":4200,"discountprcn":10,"discamt":420},
                                    {"datakey":"prod07","tprodcode":"prod07","quantity":70,"rate":80,"amount":5600,"discountprcn":10,"discamt":560}
                                ],
                    "datapart3":[
                                    {"datakey":"3prod01","tprodcode3":"3prod01","quantity3":10,"rate3":20,"amount3":200,"discountprcn3":10,"discamt3":20},
                                    {"datakey":"3prod02","tprodcode3":"3prod02","quantity3":20,"rate3":30,"amount3":600,"discountprcn3":10,"discamt3":60},
                                    {"datakey":"3prod03","tprodcode3":"3prod03","quantity3":30,"rate3":40,"amount3":1200,"discountprcn3":10,"discamt3":120},
                                    {"datakey":"3prod04","tprodcode3":"3prod04","quantity3":40,"rate3":50,"amount3":2000,"discountprcn3":10,"discamt3":200},
                                    {"datakey":"3prod05","tprodcode3":"3prod05","quantity3":50,"rate3":60,"amount3":3000,"discountprcn3":10,"discamt3":300},
                                    {"datakey":"3prod06","tprodcode3":"3prod06","quantity3":60,"rate3":70,"amount3":4200,"discountprcn3":10,"discamt3":420},
                                    {"datakey":"3prod07","tprodcode3":"3prod07","quantity3":70,"rate3":80,"amount3":5600,"discountprcn3":10,"discamt3":560}
                                ],
                    "datapart4":[
                                    {"datakey":"4prod01","tprodcode4":"4prod01","quantity4":10,"rate4":20,"amount4":200,"discountprcn4":10,"discamt4":20},
                                    {"datakey":"4prod02","tprodcode4":"4prod02","quantity4":20,"rate4":30,"amount4":600,"discountprcn4":10,"discamt4":60},
                                    {"datakey":"4prod03","tprodcode4":"4prod03","quantity4":30,"rate4":40,"amount4":1200,"discountprcn4":10,"discamt4":120},
                                    {"datakey":"4prod04","tprodcode4":"4prod04","quantity4":40,"rate4":50,"amount4":2000,"discountprcn4":10,"discamt4":200},
                                    {"datakey":"4prod05","tprodcode4":"4prod05","quantity4":50,"rate4":60,"amount4":3000,"discountprcn4":10,"discamt4":300},
                                    {"datakey":"4prod06","tprodcode4":"4prod06","quantity4":60,"rate4":70,"amount4":4200,"discountprcn4":10,"discamt4":420},
                                    {"datakey":"4prod07","tprodcode4":"4prod07","quantity4":70,"rate4":80,"amount4":5600,"discountprcn4":10,"discamt4":560}
                                ],
                    "datapart5":[
                                    {"datakey":"5prod01","tprodcode5":"5prod01","quantity5":10,"rate5":20,"amount5":200,"discountprcn5":10,"discamt5":20},
                                    {"datakey":"5prod02","tprodcode5":"5prod02","quantity5":20,"rate5":30,"amount5":600,"discountprcn5":10,"discamt5":60},
                                    {"datakey":"5prod03","tprodcode5":"5prod03","quantity5":30,"rate5":40,"amount5":1200,"discountprcn5":10,"discamt5":120},
                                    {"datakey":"5prod04","tprodcode5":"5prod04","quantity5":40,"rate5":50,"amount5":2000,"discountprcn5":10,"discamt5":200},
                                    {"datakey":"5prod05","tprodcode5":"5prod05","quantity5":50,"rate5":60,"amount5":3000,"discountprcn5":10,"discamt5":300},
                                    {"datakey":"5prod06","tprodcode5":"5prod06","quantity5":60,"rate5":70,"amount5":4200,"discountprcn5":10,"discamt5":420},
                                    {"datakey":"5prod07","tprodcode5":"5prod07","quantity5":70,"rate5":80,"amount5":5600,"discountprcn5":10,"discamt5":560}
                                ],
                    "datapart6":{
                                    "shipingdetail":"no shiping detail",
                                    "shipingamount":1500.50
                                },                    
                    "datapart7":{
                                    "gstdetail":"gst detail to input here, it is like address field",
                                    "gstamount":2000
                                }
                }

}
===========================
my table structure is below
==========================
TABLE CUSTOMERMASTER(
    DOCREFNO INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    MAINDATAKEY VARCHAR(400) NOT NULL UNIQUE,
    RECORDSTATUS VARCHAR(10) NOT NULL,
    MAINDATA JSON NOT NULL
        ) ENGINE = INNODB";

I validated JSON online and it is showing valid JSON, in php it is not working

I tried

=======

$addsql = "INSERT INTO customermaster (DOCREFNO, MAINDATAKEY, RECORDSTATUS, MAINDATA) VALUES 
            ((1,'CUST01','ACTIVE',$data1))";
try 
{
    $conn->query($addsql);
} 
catch (Exception $e) 
{
    echo "Error Save Data: " . $conn->error;
}

Error i am getting

===========

ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘”docrefno”:1, “maindatakey”:”x001592″, “maindata”: { ‘ at line 3

GloriaFood PHP CURL API

I don’t know why, but this Curl API is unable to retrieve the data from “Accepted Orders” even though the response status code is 200 and the response body is 0.

Code:

$curl = curl_init();
curl_setopt_array($curl, [
 CURLOPT_URL => "https://pos.globalfoodsoft.com/pos/order/pop",
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => "",
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 30,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => "POST",
 CURLOPT_HTTPHEADER => [
   "Accept: application/json",
   "Authorization: xxxxxxxxxxxxxxx",
   "Glf-Api-Version: 2"
 ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

Body

{
“count”: 0,
“orders”: []
}

However, the same Curl API is able to retrieve the data in the “Fetch Menu”.

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://pos.globalfoodsoft.com/pos/menu",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Authorization: XXXXXXX",
    "Glf-Api-Version: 2"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

REF – API Docs: https://github.com/GlobalFood/integration_docs

One WP Plugin shortcode attribute changes properly, the other one sticks to the first-passed value across whole site

This is a WordPress with PHP/React Plugin.

There are two attributes that are supposed to be given to the plugin via the shortcode: lang and formType. There are multiple instances of the plugin across the site: page 1, page 2, etc.

Say I load page 1, which has the plugin with attributes lang=lang1 and formType=type1. So far, everything works as expected.

I then load page 2, which has the plugin with attributes lang=lang2and formType=type2. On this page, it loads the plugin with the correct language, but it uses formType=type1. This is reflected in the HTML element that the PHP loads the attributes into for the React app to read from.

I tried on a different WordPress site that uses Autoptimize and Breeze for caching. I clear those caches and try to load page 2 again, and it still uses formType=type1.

If page 2 is loaded first, then page 1 will use formType=type2.

In case it helps, this is what the code of the shortcode looks like:

add_shortcode('plugin_name', function ($atts) {
    $args = shortcode_atts([
        'lang' => 'lang1',
        'formType' => 'type2'
    ], $atts);
    return plugin_name_shortcode($args['lang'], $args['formType']);
});

And this is the code for the plugin_name_shortcode(...):

function plugin_name_shortcode($lang = 'lang1', $formType = 'type2')
{
    $config = load_config();
    $country = detect_country();
    $config['country'] = $country;

    wp_enqueue_style('plugin-name-style');
    wp_enqueue_script('plugin-name-script');
    wp_localize_script(
        'plugin-name-script',
        'businessConfig',
        $config
    );

    return make_plugin_html($lang, $formType);
}

What I’ve tried

  • Tinkering with .htaccess (the server uses Apache) to not allow caching for .js files and confirmed that the resulting .js file downloaded has “max-age=0”.
  • Renaming the formType attribute

Run xdebug on xampp, netbeans – PHP 8.2

Good morning,
I’m trying to run Xdebug on my Xampp server (Windows 10) under php 8.2. I read a lot of documentations and forum and still have problem – Netbeans not showing any error, but I can’t see Variables, Call Stack, etc. Only breakpoints “works” (application paused, that’s all, not more). What I’m doing bad?

Xdebug version: 3.2.0-8.2-vs16-x86_64 from download

php.ini:
output_buffering=off

enter image description here

Xampp is installed in D:ProgramyXampp. I have few virtual hosts (working) on different ports (8000-8090),cuz https and running website preview on phone, so port 9000 isn’t occupied.

NetBeans:

enter image description here

Thank you for your time and help.

get custom output for use in convase js from php server

i have a table in worodpress site and output from this table is like :

{
  { [line1]=> array(3) {{'x'=>'5' , 'y'=>'8},{'x'=>'5' , 'y'=>'8},{'x'=>'5' , 'y'=>'8}},
  { [line2]=> array(3) {{'x'=>'5' , 'y'=>'8},{'x'=>'5' , 'y'=>'8},{'x'=>'5' , 'y'=>'8}}
}

i want show chart by this data and needed output is like :

<script type="text/javascript">
  window.onload = function () {
    var chart = new CanvasJS.Chart("chartContainer",
      {
        axisX: {
          title: "Thick Axis line",
          lineThickness: 6

        },
        data: [{
          type: "line",
          title: 'line1',
          dataPoints: [{ x: 5, y:8 }, { x: 5, y: 8 }]
        }, {
          type: "column",
          title: 'line2',
          dataPoints: [{ x: 5, y: 8 }, { x: 5, y: 8}]
        }
        ]
      });

    chart.render();
  }
</script>

how convert php output to custom needed data?

Of course, the number of lines is different and can be from one line to 20 lines

install of laravel/laravel failed

i am getting an error while installing laravel
and the error is
Install of laravel/laravel failed
In ZipDownloader.php line 184:
Failed to extract laravel/laravel: (7) “C:Program Files7-Zip7z.EXE” x -bb0 -y C:xampphtdocsvendorcomposertmp-
bb83102c5c38c72f1b4f0d18f94cdbb5 -oC:xampphtdocsvendorcomposer882f3f31

create-project [-s|–stability STABILITY] [–prefer-source] [–prefer-dist] [–prefer-install PREFER-INSTALL] [–repositor
y REPOSITORY] [–repository-url REPOSITORY-URL] [–add-repository] [–dev] [–no-dev] [–no-custom-installers] [–no-scrip
ts] [–no-progress] [–no-secure-http] [–keep-vcs] [–remove-vcs] [–no-install] [–no-audit] [–audit-format AUDIT-FORMA
T] [–ignore-platform-req IGNORE-PLATFORM-REQ] [–ignore-platform-reqs] [–ask] [–] [ [ []]]

enter image description here

i just tried the command

composer create-project laravel/laravel projectname

How to correctly pass authenticated user to queue Laravel?

I want to send emails to new registered users.
Sending emails using a queue.
The job is added to the queue when the user is authenticated.

Controller:

namespace AppHttpControllers;

class LoginController extends Controller
{

   public function login(Request $request)
    {

        $data = $request->validate([
            'email' => ['required', 'email'],
            'password' => ['required', 'min:5', 'max:10', 'confirmed']
        ]);

        if (Auth::attempt($data, $request->input('remember'))) {

            $request->session()->regenerate();

            **SendEmail::dispatch(Auth::user());**

            return redirect()->route('web.category');
        }
        return to_route('login')->withErrors(['fail-login' => 'error']);
    }

AppJobsSendEmail class:

namespace AppJobs;

 class SendEmail implements ShouldQueue
{

    public $user;

    public function __construct($user)
    {
        $this->user = $user;
    }

    public function handle(): void
    {
        **event(new Registered($this->user)); **
    }

As a result, emails are not sent because an unauthenticated user is passed to the Jobs/SendEmail class.

How did I check it?

The handle method of the SendEmail class dispatches the** Registered event** to the SendEmailVerificationNotification listener.

Next, the listener calls its own handle method in which it checks the user and if the check is passed, the letter is sent to the user.

And here are the test conditions if ($event->user instanceof MustVerifyEmail && ! $event->user->hasVerifiedEmail()).

The user does not pass this test.

What’s my mistake?

Warning: Undefined array key “id” in D:XAMPPhtdocsiceicoCURDindex.php on line 20

Warning: Undefined array key “id” in D:XAMPPhtdocsiceicoCURDindex.php on line 20

I am trying to make a curd operation in php but this error I am faced .

Here i am used bootstrap for front end .
for backend i was used php.
and mysql database.

php code

<?php
$server = "localhost";
$user = "root";
$password = "";
$db = "student-registration";

$conn = mysqli_connect($server, $user, $password, $db);

if (!$conn) {
  die("Server not connected" . mysqli_connect_error());

}


if ($_SERVER["REQUEST_METHOD"] == "POST") {
  $name = $_POST['name'];
  $email = $_POST['email'];
  $number = $_POST['number'];
  $class = $_POST['class'];
  $id = $_FILES['id'];
  // print_r($_FILES['id']);
  // $id_loc = $_FILES['id']['temp_name'];
  // $id_name = $_FILES['id']['name'];
  // $id_des = 'uploadId/' . $id_name;
  // move_uploaded_file($id_loc, 'uploadId/' . $id_name);

  // $sql = "INSERT INTO 'student'('Name','Email','Contact','Class','id') VALUES('$name','$email','$number','$class','$id_des')";
  // $result = mysqli_query($conn, $sql);

}

?>

html code

<!DOCTYPE html>
<html>

<head>

  <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">
  <title>Document</title>
</head>

<body>
  <nav class="navbar bg-body-tertiary">
    <div class="container-fluid">
      <a class="navbar-brand" href="#">
        Student Registration
      </a>
    </div>
  </nav>

  <form action="/iceico/CURD/index.php" method="post" >
    <div class="container my-4 w-50">
      <div class="mb-3">
        <label for="name" class="form-label">Name</label>
        <input type="text" class="form-control" id="name" name="name"
          placeholder=" Prathamesh Manoj Rathod">
      </div>
      <div class="mb-3">
        <label for="email" class="form-label">Email</label>
        <input type="email" class="form-control" id="email" name="email"
          placeholder="[email protected]">
      </div>
      <div class="mb-3">
        <label for="number" class="form-label">Contact</label>
        <input type="number" class="form-control" id="number" name="number" placeholder="9130*******">
      </div>
      <div class="mb-3">
        <label for="class" class="form-label">Class</label>
        <input type="text" class="form-control" id="class" name="class"
          placeholder="PHP Developer (ICEICO)">
      </div>

      <div class="mb-3">
        <label for="id" class="form-label">id</label>
        <input type="file" class="form-control" id="id" name="id">
       
      </div>
      
        <button type="submit" class="btn btn-primary">Submit</button>
    
    </div>
  </form>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
  integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>

</html>

I was try to change the name but still face issue.