久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='ydjFY'></bdo><ul id='ydjFY'></ul>

<small id='ydjFY'></small><noframes id='ydjFY'>

<tfoot id='ydjFY'></tfoot>
  • <legend id='ydjFY'><style id='ydjFY'><dir id='ydjFY'><q id='ydjFY'></q></dir></style></legend>
  • <i id='ydjFY'><tr id='ydjFY'><dt id='ydjFY'><q id='ydjFY'><span id='ydjFY'><b id='ydjFY'><form id='ydjFY'><ins id='ydjFY'></ins><ul id='ydjFY'></ul><sub id='ydjFY'></sub></form><legend id='ydjFY'></legend><bdo id='ydjFY'><pre id='ydjFY'><center id='ydjFY'></center></pre></bdo></b><th id='ydjFY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ydjFY'><tfoot id='ydjFY'></tfoot><dl id='ydjFY'><fieldset id='ydjFY'></fieldset></dl></div>

        服務器端的 CURL HTTP 身份驗證

        CURL HTTP Authentication at server side(服務器端的 CURL HTTP 身份驗證)
          <tbody id='ZNXU0'></tbody>

            <legend id='ZNXU0'><style id='ZNXU0'><dir id='ZNXU0'><q id='ZNXU0'></q></dir></style></legend>
            1. <small id='ZNXU0'></small><noframes id='ZNXU0'>

            2. <tfoot id='ZNXU0'></tfoot>

              <i id='ZNXU0'><tr id='ZNXU0'><dt id='ZNXU0'><q id='ZNXU0'><span id='ZNXU0'><b id='ZNXU0'><form id='ZNXU0'><ins id='ZNXU0'></ins><ul id='ZNXU0'></ul><sub id='ZNXU0'></sub></form><legend id='ZNXU0'></legend><bdo id='ZNXU0'><pre id='ZNXU0'><center id='ZNXU0'></center></pre></bdo></b><th id='ZNXU0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZNXU0'><tfoot id='ZNXU0'></tfoot><dl id='ZNXU0'><fieldset id='ZNXU0'></fieldset></dl></div>
                  <bdo id='ZNXU0'></bdo><ul id='ZNXU0'></ul>

                • 本文介紹了服務器端的 CURL HTTP 身份驗證的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Zend 構建 Web 服務,我必須在向用戶發送響應之前對其進行身份驗證.用戶將使用 curl 向服務器頁面發送請求,并以 curl_setopt($curl, CURLOPT_USERPWD, 'key:pass');

                  I am building a web service with Zend and i have to authenticate the users before sending them response. The user will send a request to a server page, using curl, passing his credentials in the form of curl_setopt($curl, CURLOPT_USERPWD, 'key:pass');

                  我使用 Zend 框架,因此服務器端頁面表示為:

                  Iam using Zend framework and so the server side page is denoted like:

                  http://www.example.com/app_name/public/controller/action/parameter

                  這里是用戶請求的總代碼(client.php):

                  Here is the total code for user's request (client.php):

                  <?php
                  $curl = curl_init('http://www.example.com/app/public/user/add/1');
                  
                  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);                         
                  curl_setopt($curl, CURLOPT_USERPWD, 'username:password');
                  curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);                    
                  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);                          
                  curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);                           
                  curl_setopt($curl, CURLOPT_USERAGENT, 'Sample Code');
                  
                  $response = curl_exec($curl);                                          
                  $resultStatus = curl_getinfo($curl);                                   
                  
                  if($resultStatus['http_code'] == 200) {
                      echo $response;
                  } else {
                      echo 'Call Failed '.print_r($resultStatus);                         
                  }
                  
                  ?>
                  

                  現在我想要的是,我必須能夠在服務器端(在我的 Zend 控制器中)檢索用戶名和密碼,以便我可以驗證數據庫中的用戶憑據并相應地發送響應.那么如何在另一個頁面中進行身份驗證?

                  Now what i want is that, i must be able to retrieve the username and password at the server side (in my zend controller), so that i can verify the user credentials from database and send the response accordingly. So how can i do authentication in another page?

                  推薦答案

                  Zend Framework 有一個現成的組件來處理 HTTP 身份驗證.

                  Zend Framework has a ready-made component for handling HTTP authentication.

                  • http://framework.zend.com/manual/en/zend.auth.adapter.http.html

                  如果你不想使用它,你仍然可以走老派"的方式,如

                  If you don't want to use that, you can still go the "old-school" way, as described in

                  • http://php.net/manual/en/features.http-auth.php

                  并手動檢查 $_SERVER['PHP_AUTH_USER']$_SERVER['PHP_AUTH_PW']

                  這篇關于服務器端的 CURL HTTP 身份驗證的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                      <tbody id='Q1sm5'></tbody>

                  1. <tfoot id='Q1sm5'></tfoot>

                        <bdo id='Q1sm5'></bdo><ul id='Q1sm5'></ul>

                        <small id='Q1sm5'></small><noframes id='Q1sm5'>

                        <i id='Q1sm5'><tr id='Q1sm5'><dt id='Q1sm5'><q id='Q1sm5'><span id='Q1sm5'><b id='Q1sm5'><form id='Q1sm5'><ins id='Q1sm5'></ins><ul id='Q1sm5'></ul><sub id='Q1sm5'></sub></form><legend id='Q1sm5'></legend><bdo id='Q1sm5'><pre id='Q1sm5'><center id='Q1sm5'></center></pre></bdo></b><th id='Q1sm5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Q1sm5'><tfoot id='Q1sm5'></tfoot><dl id='Q1sm5'><fieldset id='Q1sm5'></fieldset></dl></div>
                          • <legend id='Q1sm5'><style id='Q1sm5'><dir id='Q1sm5'><q id='Q1sm5'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 蜜桃在线一区二区三区 | 免费在线观看一区二区三区 | 免费一级黄色电影 | 毛片av免费看 | 亚洲欧美一区二区三区情侣bbw | 欧美精品被| 在线精品一区二区 | 欧美视频区 | 狠狠躁18三区二区一区 | 一级黄在线观看 | 伦理午夜电影免费观看 | 日韩免费一区二区 | 黄色一级片在线播放 | 欧美日韩久久精品 | 有码一区| 91精品中文字幕一区二区三区 | 玖玖玖av | 亚洲人精品| 美女爽到呻吟久久久久 | 狠狠躁天天躁夜夜躁婷婷老牛影视 | 日韩欧美中文 | 午夜视频免费在线 | 精品久久九九 | 久久久久亚洲精品 | 成人福利 | 国产精品自产拍在线观看蜜 | 精品国产乱码久久久久久影片 | 狠狠干影院 | 特级特黄特色的免费大片 | 手机在线一区二区三区 | 亚洲风情在线观看 | 成人在线电影网站 | 日韩1区| 高清视频一区 | 日韩a在线 | 国产精品一区二区三区免费观看 | 欧洲一级毛片 | 久草热线 | 久久久青草婷婷精品综合日韩 | 国产a区| 中文字幕国产 |