Advertisement
Guest User

hmm

a guest
Feb 25th, 2013
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 KB | None | 0 0
  1. <?php
  2.  
  3. if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
  4.  
  5. class Sms_analysis extends MX_Controller {
  6.    
  7.     public function index() {
  8.         $sms_id = 9075599;
  9.         $prefix = 'tavjav';
  10.         $uzenet = 'test3';
  11.         $telefonszam = '36703300943';
  12.         $kategoria = 2;
  13.  
  14.         $this->upload_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria );
  15.     }
  16.  
  17.     public function upload_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria, $ip_address = $this->get_client_ip() ) {
  18.         $this->load->model( 'backend/backend' );
  19.         $this->backend->create_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria, $ip_address );
  20.     }
  21.  
  22.     function get_client_ip() {
  23.         if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {   //check ip from share internet
  24.             $ip = $_SERVER['HTTP_CLIENT_IP'];
  25.         } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {   //to check ip is pass from proxy
  26.             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
  27.         } else {
  28.             $ip = $_SERVER['REMOTE_ADDR'];
  29.         }
  30.         return $ip;
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement