Skip to content

ArTDsL/PHPRADART

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPRADART


VERSION: 1.0.0-rc


This PHP with a little bit of JS let us gather some users information uppon their visiting the website;

It is not completed and maybe in the future will be refactored, so just keep in mind that this is not the final work!

What you can expect in this version?

Well, this version is packed with:

  • Dispositive Information:
    • User Operational System;
    • User Operational System Kernel;
    • User Operational System Architecture;
    • User Country and State;
    • Dispositive Type:
      • Is a Desktop?;
      • Is a Mobile?;
      • Is a Tablet?;
    • Browser Name;
    • Browser Version;
    • Is User using Browser inside an app?;
    • Dispositive Screen Width and Height;
    • Dispositive Time Zone;
    • User Is a Bot? ()
      • Human - User is checked and is HUMAN!
      • Probably - User is probably a BOT, there was no response from JS request and/or user disable JS in his navigator;
      • Yes - Malformed request and/or BOT trying to test requests (avoid, code should never malform a request since everything is automatic);

(): This classification is generated along with requests! I should probably update this later in a new version with a more robust way to identify those...

Requirements

  • PHP 8.3+

"Installing"

1) Edit config file config.RADART.php and set your URL.

define('RADART_URL', 'localhost'); //here

Change to your website URL, do not use HTTP or HTTPS, RADART is going to include HTTPS automatically, preffer to use only the address that RADART is installed, for example, if your website goes with "www.example.com" you will replace for "example.com"!

2) Include PHPRADART.php in the place you want to use.

include_once(__DIR__.'/PHPRADART-master/PHPRADART.php');

Setting things up

First, you have to DECIDE IF YOU WANT THE USER EXTRA INFORMATION!!!


If your answer was YES check this snippet and information, otherwiser jump it:

What can you expect from "User Extra Information", well, some stuff that PHP can't actually see, like: Timezone, Country, State, JS Enable (Bot test), Dispositive size Width and Height and some other stuffs...

We need to interrogate client-side to fetch this info, and the best way to do that is by using this:

\PHPRADART\DETECTOR\INFO::CaptureUserExtraInformation();

CaptureUserExtraInformation() can be set in the top of your pages, this will generate a Cookie with all user information that PHP needs, and you can capture later (in register or login, for example) with:

$einfo = \PHPRADART\DETECTOR\INFO::GetUserExtraInformation();
if($einfo != false){
	print_r($einfo);
}

Return will be type of array with all information gather in client-side.


But, if your answer was "NO" or you just want to continue and grab both information (recommended), check this:

To fetch only the "User Basic Information" you'll need to call the function:

$basic_info = \PHPRADART\DETECTOR\DISPOSITIVE::GetDispositiveInfo();

Return will be type of array with all information gather in server-side from user request.

Different from "User Extra Information", this function can be executed and grabbed at the same time and don't need any Capture, since the information is already available when user load the page!

Know Issues

  • cURL are not sending/receiving answer properly:
    • R: Check config.RADART.php and if you're in LOCAL MODE change RADART_SLL_REQ from TRUE to FALSE, use TRUE only with a Secure SSL, in Local Tests use always FALSE

Issues

I coundn't find any issue on local testing, but i'll start production test in some days, if you find any issue, please report here!

More information

Feel free to contact me on X @ArT_DsL, with private message and/or a simple tweet, i'll be glad to answer any topics related!

About

Dispositive, Browser, Bot, Information, some other cool stuffs!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages