当前位置: 首页>>代码示例>>PHP>>正文


PHP getRealIpAddr函数代码示例

本文整理汇总了PHP中getRealIpAddr函数的典型用法代码示例。如果您正苦于以下问题:PHP getRealIpAddr函数的具体用法?PHP getRealIpAddr怎么用?PHP getRealIpAddr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getRealIpAddr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: user_data

<?php

if (verif_connect(true)) {
    /**
     * Variables Globales
     */
    $ID = user_data('Account_ID');
    $Date = date('Y-m-d H:i:s');
    $IP = getRealIpAddr();
    $Pseudo = logged_data('Account_Pseudo');
    init_stat_session();
    clear_token();
    // => trop brutal...
    clear_battle();
    debug_log('Account_ID::' . logged_data('Account_ID'));
    debug_log('Account_Pseudo::' . logged_data('Account_Pseudo'));
    /**
     * Vérification des sanctions pour l'utilisateur
     */
    $Warning_List = get_db("get_sanction_user", array('Account_ID' => logged_data('Account_ID')));
    if (!empty($Warning_List)) {
        extract(stripslashes_r($Warning_List));
        $message = "Vous avez recu un(e) {$Sanction_Type} de la part de {$Sanction_Transmitter}\\n\\n{$Sanction_Message}";
        delete_db('Caranille_Sanctions', array('Sanction_ID' => $Sanction_ID));
    }
    /*
    Mise à jour du compte en temps réel
    */
    //get_user($Pseudo);
    if (verif_auth()) {
        init_equipement_session();
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:31,代码来源:Refresh.php

示例2: log_download

function log_download()
{
    $fp = fopen('/home/webadmin/cuke4ninja.com/pdfdownload', 'a');
    fwrite($fp, date("F j, Y, g:i a") . "\t" . getRealIpAddr());
    fwrite($fp, "\n");
    fclose($fp);
}
开发者ID:blowzerr,项目名称:cuke4ninja,代码行数:7,代码来源:download-pdf.php

示例3: log_insert

 /** function insert log
 	------------------------------------------------------------------------ **/
 function log_insert($log)
 {
     require_once 'system/libraries/func.php';
     $ip = getRealIpAddr();
     $session_id = $this->session->userdata('session_id');
     $auth = $this->session->userdata('itlogin_id');
     $sql = "INSERT INTO itcore_log (ip,session,auth,description) VALUES(" . $this->db->escape($ip) . "," . $this->db->escape($session_id) . "," . $this->db->escape($auth) . "," . $this->db->escape($log) . ")";
     return $this->db->query($sql);
 }
开发者ID:ahromi,项目名称:feunisba,代码行数:11,代码来源:model_login.php

示例4: getdatalog

function getdatalog($st, $email)
{
    $ip = getRealIpAddr();
    putenv("TZ=Asia/Saigon");
    $datetime = date("Y-m-d H:i:s");
    $date = date("Y-m-d");
    $data = array('user' => $email, 'ip' => $ip, 'event' => $st, 'time' => $datetime, 'date' => $date);
    return $data;
}
开发者ID:lxthien,项目名称:batdongsan,代码行数:9,代码来源:my_helper.php

示例5: web

function web($q, $start)
{
    $json = gethtml("https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=" . $q . "&as_q=" . $q . "&userip=" . getRealIpAddr() . "&start=" . $start);
    $data = json_decode($json);
    foreach ($data->responseData->results as $result) {
        $results[] = array('visibleUrl' => $result->visibleUrl, 'url' => $result->url, 'title' => $result->title, 'abstract' => $result->content);
    }
    return $results;
}
开发者ID:soitun,项目名称:meta,代码行数:9,代码来源:functions.php

示例6: register_request

function register_request()
{
    global $prefixe_salt, $suffixe_salt;
    extract(addslashes_r(stripslashes_r($_POST)));
    $Date = date('Y-m-d H:i:s');
    $IP = getRealIpAddr();
    $filter = uniqid();
    $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password);
    $key = uniqid();
    insert_db('Caranille_Accounts', array('Account_Pseudo' => strip_tags($Pseudo), 'Account_Password' => strip_tags($pswd), 'Account_Salt' => $filter, 'Account_Email' => $Email, 'Account_Sexe' => $Sexe, 'Account_Inscription' => $Date, 'Account_Last_IP' => $IP, 'Account_HP_Remaining' => 100, 'Account_Key' => $key, 'Account_valid' => 0, 'Account_Level' => 1, 'Account_Order' => 1, 'Account_Reason' => 'None', 'Account_Status' => "Authorized", 'Account_Access' => "Member", 'Account_Guild_ID' => 0, 'Account_HP_Bonus' => 0, 'Account_MP_Remaining' => 10, 'Account_MP_Bonus' => 0, 'Account_Strength_Bonus' => 0, 'Account_Magic_Bonus' => 0, 'Account_Agility_Bonus' => 0, 'Account_Defense_Bonus' => 0, 'Account_Experience' => 0, 'Account_Golds' => 0, 'Account_Notoriety' => 0, 'Account_Chapter' => 1, 'Account_Mission' => 1, 'Account_Step' => 2));
    $user_record = get_db('request_account', $_POST);
    return $user_record;
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:13,代码来源:Register.php

示例7: gravarLog

	public function gravarLog($tipo,$usuario,$instituicao){

		$banco = $this->getBancoDados(); 

		if ($tipo == 'ALUNO'){
			$query = "INSERT INTO tbl_log_acesso (instituicao, aluno,ip,programa) VALUES (".$instituicao.",".$usuario.",'".getRealIpAddr()."','".$_SERVER["PHP_SELF"]."') ";
			if(!$banco->updateSQL($query)) {
				#throw new Exception("ERRO AO LOGAR"); 
			}
		}
		if ($tipo == 'PROFESSOR'){
			$query = "INSERT INTO tbl_log_acesso (instituicao, professor,ip,programa) VALUES (".$instituicao.",".$usuario.",'".getRealIpAddr()."','".$_SERVER["PHP_SELF"]."') ";
			if(!$banco->updateSQL($query)) {
				#throw new Exception("ERRO AO LOGAR"); 
			}
		}
	}
开发者ID:nowakis,项目名称:TesteNet,代码行数:17,代码来源:class.log.DAO.php

示例8: session_start

<?php

include 'functions.php';
session_start();
// You need to set your own parameters!!
define('MYSQL_SERVER', 'localhost:3306');
define('MYSQL_USER', 'erobin258791_db');
define('MYSQL_DB', 'erobin258791_db');
define('MYSQL_PASSWORD', '7d0H8hWG');
// You'd need to activate it once you have operational system
$GLOBALS['DB'] = mysql_connect(MYSQL_SERVER, MYSQL_USER, MYSQL_PASSWORD) or die("Cannot connect to the MySQL server: \n" . mysql_error());
mysql_select_db(MYSQL_DB, $GLOBALS['DB']) or die('Cannot select MySQL database');
$HTML['email'] = "";
$HTML['dob'] = "";
foreach ($HTML as $key => &$value) {
    $value = utf8HTML(getRequest($key, true, 'post'));
}
$HTML['id'] = "";
$HTML['ip'] = getRealIpAddr();
connect("INSERT INTO project (email, dob, ip) VALUES ('" . $HTML['email'] . "', '" . $HTML['dob'] . "' , '" . $HTML['ip'] . "')");
set_SESSION("id", mysql_insert_id());
set_SESSION("email", $HTML['email']);
set_SESSION("dob", $HTML['dob']);
set_SESSION("ip", $HTML['ip']);
return true;
开发者ID:umairsajid,项目名称:Homeworks,代码行数:25,代码来源:login.php

示例9: ost_ticket_note

        $name = $_SESSION['FIRST_NAME'] . " " . $_SESSION['LAST_NAME'];
        $qry = "INSERT INTO ost_ticket_note(ticket_id,staff_id,source,title,note,created) VALUES('" . $ticket_id . "','" . $_SESSION['STAFF_ID'] . "','" . $name . "','Ticket Updated by " . $name . "','" . $note . "',NOW())";
        $res = mysql_query($qry) or die("Bingo...right?");
    }
    echo "Update Successful! Wow, you just totally changed that data like a pro.";
    mysql_close($link);
}
/* Create a new ticket */
if (isset($_GET['new'])) {
    $link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("pickle");
    mysql_select_db(DB_NAME) or die("Dig Doug");
    $data = superSanitize($_POST);
    require_once 'util.php';
    $ticketID = randNumber();
    $duedate = explode('/', $data['duedate']);
    $qry = "INSERT INTO \n\t\tost_ticket(`ticket_id`, `ticketID`, `dept_id`, `priority_id`, `topic_id`, `staff_id`, `email`, `name`, `subject`, `helptopic`, `phone`, `phone_ext`, `ip_address`, `status`, `source`, `isoverdue`, `isanswered` " . ($data['duedate'] == '' ? "" : ",`duedate`") . ",`created`) \n\t\t VALUES('" . $data['ticket_id'] . "', '" . $ticketID . "', '" . $data['dept_id'] . "', '" . $data['priority_id'] . "', '" . $data['helptopicID'] . "', '" . $data['assigned'] . "', '" . $data['email'] . "', '" . $data['name'] . "', '" . $data['subject'] . "', '" . $data['helptopic'] . "', '" . $data['phone'] . "', '" . $data['phone_ext'] . "', '" . getRealIpAddr() . "', '" . "open" . "', '" . $data['ticket_source'] . "', '" . "0" . "', '" . "0" . "'," . ($data['duedate'] == '' ? "" : " '" . gmdate('Y-m-d H:i:s', mktime(0, 0, 0, $duedate[0], $duedate[1], $duedate[2])) . "', ") . " NOW()) ";
    mysql_query($qry) or die("that is a funny joke there bob.");
    //update attachments
    /* send email here depending on whether alert user or staff is checked */
    echo "New Ticket Created Successfully! I just cannot believe you did it SO fast.";
    //echo sendMail("ross.norvell@gmail.com","ross@softwaretech.com","Test Message","<p>Are <b>you</b> actually named <em>Ross</em> too!</p>")?"Mail Sent":"Mail Fail";
    mysql_close($link);
}
/* Ticket - menu, Edit & New */
if (isset($_GET['menu'])) {
    if ($_GET['menu'] == 'new') {
        require_once 'auth.php';
        require_once 'config.php';
        require_once 'scripts.php';
        $modules = array('tabs', 'uploader', 'new_ticket', 'datepicker');
        //first make up a ticket id for later use
开发者ID:rossnorvell,项目名称:bugbase,代码行数:31,代码来源:ticket.php

示例10: getRealIpAddr

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
$filename = addslashes($_SERVER["HTTP_FILENAME"]);
$md5 = addslashes($_SERVER["HTTP_MD5"]);
$chunknumber = addslashes($_SERVER["HTTP_CHUNK"]);
$description = addslashes($_SERVER["HTTP_DESCR"]);
$ip = addslashes(getRealIpAddr());
$link = mysql_connect('mysql-s', 's210915rw', 'HeMySQ15');
if (!$link) {
    die('DB connection error: ' . mysql_error());
}
mysql_select_db("s210915_main");
if ($md5) {
    echo "Filename: {$filename}\n";
    $sql = "SELECT content FROM files WHERE filename = '{$filename}' ORDER BY chunk";
    $result = mysql_query($sql) or die("Can't execute query 3");
    $digest = hash_init("md5");
    $len = 0;
    while ($row = mysql_fetch_row($result)) {
        $len = $len + strlen($row[0]);
        hash_update($digest, $row[0]);
        echo "-MD5: " . md5($row[0]) . "\n";
开发者ID:jsyang12,项目名称:sevenzipjbinding,代码行数:31,代码来源:upload.php

示例11: addIPAddress

function addIPAddress($mid)
{
    $ip = getRealIpAddr();
    $s = mysql_query("SELECT COUNT(*) FROM `IP_Address` WHERE mid = '{$mid}' and userIP='{$ip}'") or die(mysql_error());
    $row = mysql_fetch_assoc($s);
    $c = $row['COUNT(*)'];
    if ($c == 0) {
        mysql_query("INSERT INTO `IP_Address` (`mid`,`userIP`) VALUES ('{$mid}','{$ip}')") or die(mysql_error());
    } else {
        mysql_query("UPDATE `IP_Address` set `time_access` = CURRENT_TIMESTAMP WHERE mid = '{$mid}' and userIP='{$ip}' ") or die(mysql_error());
    }
}
开发者ID:nani1441,项目名称:metube,代码行数:12,代码来源:functions.php

示例12: define

// Get a free trial at: http://corp.kaltura.com
// In your Kaltura account, get the partner Id and API Admin Secret from:
// http://www.kaltura.com/index.php/kmc/kmc4#account|integration
define("PARTNER_ID", '1357241');
define("ADMIN_SECRET", '1179e62370a3731977bf9a4c6dba3590');
define("USER_SECRET", '7501bdbfadc96b24828ce542b5c66b7a');
define("PLAYER_UICONF_ID", 27216752);
define("BUY_BUTTON_PLAYER_UICONF_ID", null);
define("PAYPAL_METADATA_PROFILE_ID", 4376762);
define("PAYPAL_CATEGORY_METADATA_PROFILE_ID", 4376772);
define("PAYPAL_USER_METADATA_PROFILE_ID", 4376782);
//Generates a USER ID based on the machine name and IP address.
function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
if (isset($_COOKIE['kaypaluserid']) && $_COOKIE['kaypaluserid'] != "") {
    $USER_ID = $_COOKIE['kaypaluserid'];
} else {
    $expire = time() + 60 * 60 * 24 * 365;
    $user = implode('_', explode(':', 'demo_user_' . mt_rand(1, 9999999) . getRealIpAddr()));
    setcookie('kaypaluserid', $user, $expire);
    $USER_ID = $user;
}
开发者ID:nagyistoce,项目名称:Kaltura-Paid-Content-Gallery-With-Stripe,代码行数:31,代码来源:kalturaConfig.php

示例13: register_admin

function register_admin()
{
    global $bdd, $prefixe_salt, $suffixe_salt;
    extract(addslashes_r($_POST));
    echo "{$Password} === {$Password_Confirm}<br/>";
    if ($Password === $Password_Confirm) {
        $Date = date('Y-m-d H:i:s');
        $IP = getRealIpAddr();
        $filter = uniqid();
        $pswd = password_encode($prefixe_salt . $filter . $suffixe_salt, $Password);
        //echo "saisie : $Password<br/>clé : ($prefixe_salt - $filter - $suffixe_salt)=>crypté : $pswd<br/>";
        $decode = password_decode($prefixe_salt . $filter . $suffixe_salt, $pswd);
        //echo " ctrl :: $decode <br/>";
        insert_db('Caranille_Accounts', array('Account_Pseudo' => $Pseudo, 'Account_Password' => $pswd, 'Account_Salt' => $filter, 'Account_Email' => $Email, 'Account_Last_Connection' => $Date, 'Account_Last_IP' => $IP, 'Account_HP_Remaining' => 100, 'Account_Level' => 1, 'Account_Order' => 1, 'Account_Valid' => 1, 'Account_Reason' => 'None', 'Account_Status' => "Authorized", 'Account_Access' => "Admin", 'Account_ID' => 1, 'Account_Guild_ID' => 0, 'Account_HP_Bonus' => 0, 'Account_MP_Remaining' => 10, 'Account_MP_Bonus' => 0, 'Account_Strength_Bonus' => 0, 'Account_Magic_Bonus' => 0, 'Account_Agility_Bonus' => 0, 'Account_Defense_Bonus' => 0, 'Account_Experience' => 0, 'Account_Golds' => 0, 'Account_Notoriety' => 0, 'Account_Chapter' => 1, 'Account_Mission' => 1));
        config_game($Email);
        return true;
    }
    return false;
}
开发者ID:galadie,项目名称:Caranille-RPG,代码行数:19,代码来源:Index.php

示例14: mysql_connect

<?php

$db = mysql_connect('riskhorizontest.cfi8996g68d1.us-east-1.rds.amazonaws.com:3306', 'dbtesting', 'engagement') or die('Could not connect: ' . mysql_error());
mysql_select_db('Risk_Horizon') or die('Could not select database');
// Strings must be escaped to prevent SQL injection attack.
$session_uuid = mysql_real_escape_string($_GET['session_uuid'], $db);
$IPv4 = getRealIpAddr();
$datetime = date("D M j G:i:s T Y");
$email = mysql_real_escape_string($_GET['email'], $db);
$hash = $_GET['hash'];
$secretKey = "engagement";
# Change this value to match the value stored in the client javascript below
function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
$real_hash = md5($session_uuid . $email . $secretKey);
if ($real_hash == $hash) {
    // Send variables for the MySQL database class.
    $query = "insert into sessions values ('{$session_uuid}', '{$IPv4}', '{$datetime}', '{$email}');";
    $result = mysql_query($query);
} else {
    // Failure
    // $message = "Subject creation failed";
开发者ID:engagementgamelab,项目名称:EL-Website,代码行数:31,代码来源:addSessions.php

示例15: queue_get_key

function queue_get_key($uid, $queue)
{
    global $MC_Queue;
    $ip = ip2long(getRealIpAddr());
    $timeout = 30;
    return $MC_Queue->get("timestamp_key{$uid},{$ip},{$timeout}(orders{$queue})");
}
开发者ID:enikesha,项目名称:v_order,代码行数:7,代码来源:utils.php


注:本文中的getRealIpAddr函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。