Advertisement
plas71k

[david files decoded] check.php

Jan 22nd, 2013
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.17 KB | None | 0 0
  1. <?php
  2. class licensing
  3. {
  4.  
  5.     public $db = NULL;
  6.  
  7.     public function __construct()
  8.     {
  9.         include( "includes/config.php" );
  10.         $this->db = mysqli_connect( $dbhost, $dbuser, $dbpass, $database );
  11.         include( "check.language.php" );
  12.         $this->checkLicence( );
  13.     }
  14.  
  15.     public function getTodaysDate( )
  16.     {
  17.         $d = date( "Y-m-d" );
  18.         $x = explode( "-", $d );
  19.         return mktime( 0, 0, 0, $x[1], $x[2], $x[0] );
  20.     }
  21.  
  22.     public function checkLicence( )
  23.     {
  24.         $ip = $_SERVER['REMOTE_ADDR'];
  25.         $domain = addslashes( $_GET['domain'] );
  26.         if ( substr( $domain, 0, 4 ) == "www." )
  27.         {
  28.             $domain = substr( $domain, 4 );
  29.         }
  30.         $sql = sprintf( "select * from `licenses` where `domain_name` = '%s' and `ip_address` = '%s'", $domain, $ip );
  31.         if ( !( $result = $this->db->query( $sql ) ) )
  32.         {
  33.             exit( mysqli_error( $this->db ) );
  34.         }
  35.         if ( $result->num_rows == 0 )
  36.         {
  37.             $sql = sprintf( "select * from `licenses` where `domain_name` = '%s'", $domain );
  38. //================================ PAYMENT ========================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement