Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
- class Sms_analysis extends MX_Controller {
- public function index() {
- $sms_id = 9075599;
- $prefix = 'tavjav';
- $uzenet = 'test3';
- $telefonszam = '36703300943';
- $kategoria = 2;
- $this->upload_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria );
- }
- public function upload_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria, $ip_address = $this->get_client_ip() ) {
- $this->load->model( 'backend/backend' );
- $this->backend->create_sms_data( $sms_id, $prefix, $uzenet, $telefonszam, $kategoria, $ip_address );
- }
- function get_client_ip() {
- if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet
- $ip = $_SERVER['HTTP_CLIENT_IP'];
- } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { //to check ip is pass from proxy
- $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
- } else {
- $ip = $_SERVER['REMOTE_ADDR'];
- }
- return $ip;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement