[FREE] Device 💻 - Get device info!

Some blocks in this extension might return an empty space if there is no data available.

Thank but when I use like this

Then no problem

I am amazing why codes do not work in this way

Actually I want to save values in mysql table.
Regards

Show Web.Url on a label to check if it's correct.
And are you sure your server side script process all incoming data correctly?

1 Like

This is script

<?php
date_default_timezone_set("Asia/Karachi");
$tstamp = date('Y-m-d H:i:s');
//--------------------------------------------------------------------------
// 4.- TAKE THE USER'S IP
//if (getenv( "HTTP_X_FORWARDED_FOR" )) {
//$YourIP = getenv( "HTTP_X_FORWARDED_FOR" );
//} else {
//$YourIP = getenv( "REMOTE_ADDR" );
//}
// Get the client's IP address
$client_ip = $_SERVER['REMOTE_ADDR'];
// Execute the arp command and store the output in $output
//exec("arp -a $client_ip", $output);
// The MAC address should be the second element in the array
//$mac_address = $output[1];
// Print the MAC address
//echo "The MAC address for $client_ip is $mac_address";
//$mac=exec('getmac');
//$mac_address=strtok($mac,' ');
//$mac_address= shell_exec("arp -a ".escapeshellarg($_SERVER['REMOTE_ADDR'])." | grep -o -E '(:xdigit:{1,2}:){5}:xdigit:{1,2}'");
$mac_address = exec('getmac');
// Storing 'getmac' value in $MAC
$mac_address = strtok($MAC, ' ');
//echo $mac_address;
//--------------------------------------------------------------------------
// database credentials
//--------------------------------------------------------------------------
$servername = "localhost";
$username = "id20649282_hassan";
$password = "Tariq@123456";
$database = "id20649282_asiacng";
$dbc = mysqli_connect($servername, $username, $password, $database);
if (!$dbc) {
    die("DATABASE CONNECTION FAILED:" . mysqli_error($dbc));
    exit();
}
$button = mysqli_real_escape_string($dbc, $_GET["button"]);
//echo $button;
// Variables
$us_name = mysqli_real_escape_string($dbc, $_GET["us_name"]);
$us_mobile = mysqli_real_escape_string($dbc, $_GET["us_mobile"]);
$us_email = mysqli_real_escape_string($dbc, $_GET["us_email"]);
// Register
if ($button == "btn_Register") {
    $query2 = "select * from login where us_mobile='$us_mobile' or us_email='$us_email'";
    $result = mysqli_query($dbc, $query2);
    $rows_count = mysqli_num_rows($result);
    if ($rows_count > 0) {
        echo "Mobile Numnber or Email already registered.";
    } else {
        $randomNumber = rand(1000, 9999);
        $query = "INSERT INTO login(us_name,us_mobile,us_email,datetime,myip,mymac,approved,us_pin)
			      VALUES ('$us_name','$us_mobile','$us_email','$tstamp','$client_ip','$mac_address','0','$randomNumber')";
        if (mysqli_query($dbc, $query)) {
            // show pincode
            $query = "select us_pin from login where us_mobile='$us_mobile'";
            $result = mysqli_query($dbc, $query);
            while ($row = mysqli_fetch_array($result)) {
                $mypin = $row['us_pin'];
            }
            echo "User added successfully <br /> Your Pin Code is $mypin <br />Please contact admin for activation";
        } else {
            echo "ERROR: Could not able to execute" . $query . " " . mysqli_error($dbc);
        }
    }
    mysqli_close($dbc);
};
//--------------------------------------------------------------------------------------
// LOGIN
//--------------------------------------------------------------------------------------
// Variables
$us_mobile = mysqli_real_escape_string($dbc, $_GET["us_mobile"]);
$us_pin = mysqli_real_escape_string($dbc, $_GET["us_pin"]);

if ($button == "btn_Login") {
    $query = "select us_pin from login where us_mobile='$us_mobile' and us_pin='$us_pin' and us_pin>0";
    $result = mysqli_query($dbc, $query);
    $rows_count = mysqli_num_rows($result);
  
   //echo $query ;
    if ($rows_count > 0) {
       
         echo "Correct Pin Code";
        // check approval
       /*
        $query = "select us_pin from login where us_mobile='$us_mobile'";
        $result = mysqli_query($dbc, $query);
       
        while ($row = mysqli_fetch_array($result)) {
            $myApproal = $row['us_pin'];
        }
      
        if ($myApproal == '0') {
            echo "Please contact Admin for Activation your account";
        }
      */
    } else {
        echo "Incorrect Pin Code";
    }
    mysqli_close($dbc);
};





Correct Pin Code
Incorrect Pin Code
Please contact Admin for account activation












id,us_name,us_mobile,us_email,us_pin,approved,datetime,mob_name





$servername = "localhost";
$username = "aaaaa";
$password = "aaaa";
$database = "aaaa";
$dbc = mysqli_connect($servername, $username, $password, $database);
if (!$dbc)
{
    die("DATABASE CONNECTION FAILED:" . mysqli_error($dbc));
    exit();
}
$button = mysqli_real_escape_string($dbc, $_GET["button"]);
//echo $button;
// Variables
$us_name = mysqli_real_escape_string($dbc, $_GET["us_name"]);
$us_mobile = mysqli_real_escape_string($dbc, $_GET["us_mobile"]);
$us_email = mysqli_real_escape_string($dbc, $_GET["us_email"]);
$mob_sim = mysqli_real_escape_string($dbc, $_GET["mob_sim"]);
$mob_name = mysqli_real_escape_string($dbc, $_GET["mob_name"]);
echo $mob_sim;
// Register
if ($button == "btn_Register")
{
    $query2 = "select * from login where us_mobile='$us_mobile' or us_email='$us_email'";
    $result = mysqli_query($dbc, $query2);
    $rows_count = mysqli_num_rows($result);
    if ($rows_count > 0)
    {
        echo "Mobile Numnber or Email already registered.";
    }
    else
    {
        $randomNumber = rand(1000, 9999);
        $query = "INSERT INTO login(us_name,us_mobile,us_email,datetime,myip,mymac,approved,us_pin,mob_sim,mob_name)
			      VALUES ('$us_name','$us_mobile','$us_email','$tstamp','$client_ip','$mac_address','0','$randomNumber','$mob_sim','$mob_name')";
        if (mysqli_query($dbc, $query))
        {
            // show pincode
            $query = "select us_pin from login where us_mobile='$us_mobile'";
            $result = mysqli_query($dbc, $query);
            while ($row = mysqli_fetch_array($result))
            {
                $mypin = $row['us_pin'];
            }
            echo "User added successfully <br /> Your Pin Code is $mypin <br />Please contact admin for activation";
        }
        else
        {
            echo "ERROR: Could not able to execute" . $query . " " . mysqli_error($dbc);
        }
    }
    mysqli_close($dbc);
};

It save everything except values from Device1.

Regards

you forget this

you mean like this

Label1 does not showing any data.

There should be some text showing on the label, otherwise how can you update data to MySQL?

Hello @Gordon_Lu , have a nice day ahead. Is it possible to get the serial number of an android device using this extension? Thank you for your kind response.

I think since android 10, we are not able to get any permanent numbers from the device. Neither IMEI nor SN.

1 Like

Hello, @Patryk_F . Thank you for your kind response, Sir.

What is the difference between NOT_CHARGING and DISCHARGING?

Many thanks :slight_smile:

Typo, should return text.

What unit the voltage in?

A device that is not charging is not connected to a charging cable. On the other hand, a device that is discharging is releasing electrical energy, possibly because of a dying battery.

Thank you.

Millivolts.

Also what is the unit for the capacity?
Thanks again, I love this extension.

Percentage ...

No but it returns 4000? I'm not saying the battery percentage.
image

Uh ... are you testing with an emulator? The unit should be percentage ...

Nope I'm using my own phone using the what it's called uhh AI Componion.

Nope

From what I've seen in your recent topic, you do seem to have installed an emulator and tested on there ...

It's not an emulator, it's my physical phone remote controlling in my laptop.

https://www.microsoft.com/en-gb/windows/sync-across-your-devices?r=1