Example #1
0
function request($url, $post = '', $timeout = 15)
{
    $context = array();
    if (is_array($post)) {
        $post = requestData($post);
    }
    $context['http'] = array('timeout' => $timeout, 'method' => 'POST', 'header' => "Content-Type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . strlen($post) . "\r\n" . "Connection: Close\r\n" . "Cache-Control: no-cache\r\n", 'content' => $post);
    return file_get_contents($url, false, stream_context_create($context));
}
Example #2
0
{
    $curl = curl_init($url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5000);
    $response = curl_exec($curl);
    $resultStatus = curl_getinfo($curl);
    if ($json) {
        $response = json_decode($response);
    }
    return $resultStatus['http_code'] == 200 ? $response : false;
}
function getDribbbleUserProjectsUrl($user, $accessToken)
{
    return 'https://api.dribbble.com/v1/users/' . $user . '/projects/?access_token=' . $accessToken;
}
function getDribbbleProjectDetailsUrl($projectId, $accessToken)
{
    return 'https://api.dribbble.com/v1/projects/' . $projectId . '/shots/?access_token=' . $accessToken;
}
$dribbbleProjects = requestData(getDribbbleUserProjectsUrl($dribbbleUser, $dribbbleAccessToken), true);
foreach ($dribbbleProjects as $project) {
    $projectData = requestData(getDribbbleProjectDetailsUrl($project->id, $dribbbleAccessToken));
    try {
        file_put_contents($outputLocation . 'project_' . $project->id . '.json', $projectData);
    } catch (Exception $e) {
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
}
Example #3
0
$printdata = array('jrecno' => $jrecno, 'v_court' => 'TPH 臺灣高等法院', 'v_sys' => 'M', 'jyear' => $jyear, 'jcase' => $jcase, 'jno' => $jno, 'jdate' => $jdate, 'jcheck' => $jcheck);
$printdata = http_build_query($printdata);
$html = '';
switch ($type) {
    case 'caselist':
        $caselisthtml = requestData($fjudQueryURL, $postdata, $fjudEnterURL, '', 'POST');
        //查詢案件列表
        $html = $caselisthtml;
        break;
    case 'casecontext':
        $casecontexthtml = requestData($fjudContextURL, $postdata, $fjudQueryURL, '', 'GET');
        //取得案件內容
        $html = $casecontexthtml;
        break;
    case 'caseprint':
        $caseprinthtml = requestData($fjudPrintURL, $printdata, $fjudContextURL, $getdata, 'GET');
        //取得友善列印
        $html = $caseprinthtml;
        break;
    case 'test':
        echo time();
        echo '<br>';
        echoArray(explode(',', $jrecno));
        break;
}
$contextpattern = '/(<pre[\\d\\D]*?>[\\d\\D]*?pre>)/';
preg_match($contextpattern, $html, $matches, PREG_OFFSET_CAPTURE);
$totalcountpattern = '/本次查詢結果共(\\d.*?)筆/';
preg_match($totalcountpattern, $html, $totalcountmatches, PREG_OFFSET_CAPTURE);
//if(count($totalcountmatches) > 0)
//echo 'TOTAL COUNT:'.$totalcountmatches[1][0];
Example #4
0
    $rss = '';
    $rss .= '<rss version="2.0">';
    $rss .= '<channel>';
    $rss .= '<title>Amazon.com Gold Box Deals</title>';
    $rss .= '<link>http://www.amazon.com/gp/goldbox</link>';
    $rss .= '<description>Amazon.com Gold Box Deals</description>';
    $rss .= '<lastBuildDate>' . date(DATE_RSS) . '</lastBuildDate>';
    foreach ($items as $item) {
        $rss .= makeRssItem($item);
    }
    $rss .= '</channel>';
    $rss .= '</rss>';
    $dom->loadXML($rss);
    return $dom->saveXml();
}
$feedData = xmlToArray(requestData(getGoldBoxUrl()), $blackList);
if ($feedSorted = sortFeedArray($feedData, 'pubDate', $feedLimitToday)) {
    if ($feedPersonalized = personalizeAffiliateLinks(array_slice($feedSorted, 0, $feedLimit), $affiliateTagId)) {
        try {
            file_put_contents($outputLocation . '/' . $outputFilename, makeRssDoc($feedPersonalized));
        } catch (Exception $e) {
            echo 'Caught exception: ', $e->getMessage(), "\n";
        }
    }
}
if ($feedToday = getTodaysItems($feedData, $currentDate)) {
    if ($feedTodayPersonalized = personalizeAffiliateLinks(array_slice($feedToday, 0, $feedLimit), $affiliateTagId)) {
        try {
            file_put_contents($outputTodayLocation . '/' . $outputTodayFilename, makeRssDoc($feedTodayPersonalized));
        } catch (Exception $e) {
            echo 'Caught exception: ', $e->getMessage(), "\n";
require 'navbar.php';
?>

<!-- Inizio Register  -->
<div class="centered" style="margin-top:24px">
    <div class="vertical-section" style="padding:0;">
        <div class="title" style="padding:24px">Your Information</div>
        <div style="padding:24px; background-image:url('img/bg1.jpg'); background-size:cover">
            <div id="avatar" onclick="chooseImage()">
            	<?php 
echo "<img id=\"preview\" src='" . requestPath() . "/profile.jpg'>";
?>
            </div>
        </div>
        <?php 
$data = requestData();
?>
        <form style="padding:12px 24px; padding-bottom:24px;" id="formPost" action="functions.php" method="post" enctype="multipart/form-data">
            <input type="hidden" name="<?php 
echo ini_get("session.upload_progress.name");
?>
" value="123" />
            <input type="hidden" value="changeInformation" name="getpage">
            <input value="<?php 
echo requestPath() . '/profile.jpg';
?>
" accept=".jpg,.jpeg" type="file" name="fileToUpload" id="fileToUpload" style="display:none;visibility:hidden;">
            <paper-input required id="currentPassword" error-message="Insert password!" name="password" label="Current Password" type="password"></paper-input>
            <input type="text" name="currentPasswordInvisible" value="<?php 
echo $data["PASSWORD"];
?>
Example #6
0
<?php

//http://fyjud.lawbank.com.tw/list2.aspx
///listcontent4.aspx
//?courtFullName=SLDM&v_court=&v_sys=&jud_year=&jud_case=&jud_no=&jud_title=&jud_jmain=&keyword=&sdate=20140103&edate=20140303&file=&page=&id=&searchkw=&jcatagory=0&switchFrom=1&issimple=-1
$listcontent4 = 'http://fyjud.lawbank.com.tw/listcontent4.aspx';
$query = 'courtFullName=SLDM&v_court=&v_sys=&jud_year=&jud_case=&jud_no=&jud_title=&jud_jmain=&keyword=&sdate=20140103&edate=20140303&file=&page=&id=&searchkw=&jcatagory=0&switchFrom=1&issimple=-1';
$referer = 'http://fyjud.lawbank.com.tw/list2.aspx';
$fullurl = $listcontent4 . '?' . $query;
echo requestData($fullurl, '', '', '', 'GET');
function requestData($url, $urlquery, $referer, $refererquery, $type)
{
    $ch = curl_init();
    if ($type == 'GET') {
        if ($urlquery != '') {
            curl_setopt($ch, CURLOPT_URL, $url . '?' . $urlquery);
        } else {
            curl_setopt($ch, CURLOPT_URL, $url);
        }
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
    } else {
        if ($type == 'POST') {
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_POST, true);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $urlquery);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        }
    }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    //return raw data
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Origin: http://jirs.judicial.gov.tw'));
Example #7
0
<?php

include_once 'include/hg_config.php';
include_once 'include/mysql_function.php';
include_once 'template/login.php';
if (requestData('login')) {
    //ambil data login(username & password)
    $username = requestData('username');
    $password = requestData('pass');
    $query = mysql_query("select * from t_member where username='******' and password='******'");
    #$query    = hg_selectMysql('t_member','','where username='******' and password='******'');
    $cek = mysql_num_rows($query);
    //bisi di injek cenah
    $username = stripcslashes($username);
    $password = stripcslashes($password);
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string($password);
    if ($cek == 1) {
        $data = mysql_fetch_array($query);
        session_start();
        $_SESSION["id_member"] = $data['id_member'];
        $_SESSION["username"] = $data['username'];
        $_SESSION["password"] = $data['password'];
        $_SESSION["sudahlogin"] = true;
        $_SESSION["tipe"] = $data['tipe'];
        if ($_SESSION["tipe"] == 1) {
            echo "<script>alert('Login Berhasil...!!!');</script>";
            header("location:a_home.php?pg=dashboard");
        } else {
            echo "<script>alert('Login Berhasil...!!!');</script>";
            header("location:m_home.php?pg=dashboard");
Example #8
0
<?php

include_once 'include/hg_config.php';
include_once 'include/mysql_function.php';
//MEMBER===========================================================================================================
//Buat Member
if (requestData('pg') == 'buatmember') {
    include_once DOCUMENT_PATH . PATHTEM . 'member/input_member.php';
    if (requestData('submit')) {
        $data = array('nm_lengkap' => requestData('nm_lengkap'), 'nm_server' => requestData('nm_server'), 'ym1' => requestData('ym1'), 'ym2' => requestData('ym2'), 'ym3' => requestData('ym3'), 'username' => requestData('username'), 'password' => requestData('password'), 'email' => requestData('email'), 'nope' => requestData('nope'));
        hg_insert('t_member', $data);
    }
}
if (requestData('pg') == 'tampilproduk') {
    $data = hg_SelectMysql('t_produk');
    $cat = hg_SelectMysql('t_kategori');
    include_once 'template/tampil_produk.php';
}
function tampil_produk()
{
    $data = hg_SelectMysql('t_kategori, t_produk', '', 'where t_produk.id_kategori=t_kategori.id_kategori', '3');
    include_once DOCUMENT_PATH . PATHTEM . 'admin/tampil_produk_index.php';
}
Example #9
0
    }
    if (requestData('pg') == 'hapusproduk') {
        $data = hg_Delete('t_produk', 'id_produk =' . requestData('id_produk'));
        if ($data) {
            echo "<script>alert('Data Berhasil di Hapus'); window.location = 'a_home.php?pg=tampilproduk';</script>";
        } else {
            echo "<script>alert('Gagal di Hapus'); window.location = 'a_home.php?pg=tampilproduk';</script>";
        }
    }
    if (requestData('pg') == 'updateproduk') {
        if (requestData('submit')) {
            $data = array('id_kategori' => requestData('id_kategori'), 'kode' => requestData('kode'), 'harga' => requestData('harga'), 'waktu' => $date);
            if ($data) {
                echo "<script>alert('Data Berhasil Dirubah'); window.location = 'a_home.php?pg=tampilproduk';</script>";
            } else {
                echo "<script>alert('Gagal Dirubah'); window.location = 'a_home.php?pg=tampilproduk';</script>";
            }
            hg_Update('t_produk', $data, 'id_produk=' . requestData('id_produk'));
        }
        $cat = hg_SelectMysql('t_kategori');
        include_once DOCUMENT_PATH . PATHTEM . 'admin/update_produk.php';
    }
    if (requestData('pg') == 'hapustiket') {
        $data = hg_Delete('t_tiket', 'id_tiket =' . requestData('id_tiket'));
        if ($data) {
            echo "<script>alert('Data Berhasil di Hapus'); window.location = 'a_home.php?pg=tampiltiket';</script>";
        } else {
            echo "<script>alert('Gagal di Hapus'); window.location = 'a_home.php?pg=tampiltiket';</script>";
        }
    }
}
Example #10
0
                <button type="button" name="logout" onclick="logout()">Logout</button>
                <p>
                <?php 
print_r($_SESSION);
?>
</p>
            </div>
        </div>

    </div>
    <div class="vertical-section" style="padding:0;">
        <div class="title" style="padding:24px; margin-top:24px; background-color:#fc183d; ">
            <iron-icon icon="description" style="margin-right:24px;"></iron-icon>
            Description
        </div>
        <div class="description" style="padding:24px">
        <?php 
echo requestData()["DESCRIPTION"];
?>
        </div>
    </div>
</div>

<!-- ___________________________________ --> 

<?php 
require 'footer.php';
?>

<?php 
require 'close.php';