Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class licensing
- {
- public $db = NULL;
- public function __construct()
- {
- include( "includes/config.php" );
- $this->db = mysqli_connect( $dbhost, $dbuser, $dbpass, $database );
- include( "check.language.php" );
- $this->checkLicence( );
- }
- public function getTodaysDate( )
- {
- $d = date( "Y-m-d" );
- $x = explode( "-", $d );
- return mktime( 0, 0, 0, $x[1], $x[2], $x[0] );
- }
- public function checkLicence( )
- {
- $ip = $_SERVER['REMOTE_ADDR'];
- $domain = addslashes( $_GET['domain'] );
- if ( substr( $domain, 0, 4 ) == "www." )
- {
- $domain = substr( $domain, 4 );
- }
- $sql = sprintf( "select * from `licenses` where `domain_name` = '%s' and `ip_address` = '%s'", $domain, $ip );
- if ( !( $result = $this->db->query( $sql ) ) )
- {
- exit( mysqli_error( $this->db ) );
- }
- if ( $result->num_rows == 0 )
- {
- $sql = sprintf( "select * from `licenses` where `domain_name` = '%s'", $domain );
- //================================ PAYMENT ========================================//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement