<label id="d53ns"></label>

           \r\n  method=\"post\">         \r\n name:         \r\n password:         \r\n      \r\n <\/form> \r\n <\/body> \r\n <\/html><\/pre>

      base_url():返回項目的基礎目錄<\/p>

      [code]upload\/qe.jpg\"><\/pre>

      current_url():返回當前查看頁面的完整URL<\/p>

      3.CI中的路由<\/p>

      路由用于配置針對某些URL與項目中實際文件的對應關系,是的URL看起來更符合用戶的習慣,又不用改變項目現(xiàn)有的結構,路由的配置文件是\/application\/config\/routes.php,可以設置默認控制器和404錯誤頁面<\/p>

      [code]$route['default_controller'] = 'welcome'; $route['404_override'] = '';<\/pre>

      更重要的功能是,如果我們要實現(xiàn)通過\/index.php\/news\/4.html訪問\/index.php\/article\/show\/1這樣一個需求,可以在routes.php定義路由關系,將原始的URL轉換成需要樣式<\/p>

      [code]$route['news\/([\\d]+)\\.html] = 'article\/show\/$1';<\/pre>

      這樣對于所有負責正則表達式的URL,都會路由到新的路徑,其中$1表示正則表達式中的第一個 用()括起來的部分<\/p>

      4.CI中的分頁<\/p>

      首先加載分頁類<\/p>

      [code]$this->load->library('pagination');<\/pre>

      然后設置分頁屬性<\/p>

      [code]\/\/ 每頁顯示的數(shù)量 \r\n$config['page_size'] = 10; \r\n\/\/ 總數(shù)據量 \r\n$config['total_rows'] = 200; \r\n\/\/ 設置分頁跳轉頁面的基礎地址 \r\n$config['base_url'] = site_url('index.php\/user\/test'); \r\n\/\/ 設置分頁顯示文字 \r\n$config['first_link'] = '首頁'; \r\n$config['next_link'] = '下一頁'; \r\n$config['prev_link'] = '上一頁'; \r\n$config['last_link'] = '末頁';<\/pre>

      初始化分頁類<\/p>

      [code]$this->pagination->initialize($config);<\/pre>

      創(chuàng)建鏈接并傳遞給視圖<\/p>

      [code]$data['links'] = $this->pagination->create_links(); $this->load->view('test', $data);<\/pre>

      通過URL獲取偏移量拼裝查詢<\/p>

      [code]$offset = (int)$this->load->uri->segment(3); $sql = \"SELECT * FROM blog_user limit $offset, $page_size\";<\/pre>

      5.CI中的文件上傳<\/p>

      首先通過控制器的方法跳轉至視圖<\/p>

      [code]public function file() {     $this->load->helper('url');     $this->load->view('file'); }<\/pre>

      在視圖中創(chuàng)建一個表單用于選擇并上傳文件<\/p>

      [code] \r\n \r\n     \r\n     \r\nDocument<\/title> \r\n<\/head> \r\n<body>
      <h1><a href="http://www.miracleart.cn/">国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂</a></h1>     \r\n<form action=\"<?php echo site_url('index.php\/user\/upload'); ?>\" method=\"post\" enctype=\"multipart\/form-data\">         \r\n<input type=\"file\" name=\"pic\" \/>         \r\n<input type=\"submit\" name=\"submit\" value=\"submit\">     \r\n<\/form> \r\n<\/body> \r\n<\/html><\/pre><p>其中,要注意第一個input的name屬性,這個屬性后面要用,在表單中將action設置為一個控制器方法,編寫對應的控制器方法<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]\r\npublic function upload() \r\n{     \r\n\/\/ 上傳文件到服務器目錄     \r\n$config['upload_path'] = '.\/upload';     \r\n\/\/ 允許上傳哪些類型     \r\n$config['allowed_types'] = 'gif|png|jpg|jpeg';     \r\n\/\/ 上傳后的文件名,用uniqid()保證文件名唯一     \r\n$config['file_name'] = uniqid();     \r\n\/\/ 加載上傳庫     \r\n$this->load->library('upload', $config);     \r\n\/\/ 上傳文件,這里的pic是視圖中file控件的name屬性     \r\n$result = $this->upload->do_upload('pic');     \r\n\/\/ 如果上傳成功,獲取上傳文件的信息     \r\nif ($result)      \r\n{         \r\nvar_dump($this->upload->data());     \r\n} \r\n}<\/pre><p>這樣就完成文件上傳了<br\/><br\/><\/p><p>6.CI中的Session<\/p><p>CI默認沒有啟動Session,而是用Cookie代替Session,首先Cookie只能保存4KB的數(shù)據,其次,在Session中保存數(shù)據馬上就可以獲取到,而Cookie中的數(shù)據要等到下次客戶端請求時才能獲取到。<br\/><br\/>首先加載Session類<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$this->load->library('session');<\/pre><p>然后通過set_userdata方法以鍵值對或關聯(lián)數(shù)組的方式保存數(shù)據<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$user = array('id' => 3, 'name'=>'dj'); $this->session->set_userdata('user', $user);<\/pre><p>用userdata方法獲取數(shù)據<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$user = $this->session->userdata('user');<\/pre><p>用unset_userdata方法刪除數(shù)據<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$this->session->unset_userdata('user');<\/pre><p>如果要保存的數(shù)據只需要用一次,可以使用閃出數(shù)據,這種數(shù)據只對下次服務器請求可用,然后會自動清除,閃出數(shù)據用set_flashdata()方法設置<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$this->session->set_flashdata('user', $user);<\/pre><p>7.CI中的驗證碼<\/p><p>首先需要在入口文件的同級目錄文件夾用于保存驗證碼圖片,比如新建captcha目錄<br\/><br\/>加載captcha輔助類<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$this->load->helper('captcha');<\/pre><p>調用create_captcha函數(shù)生成驗證碼圖片<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]$this->load->helper('url'); \r\n$vals = array     \r\n(        \r\n \/\/ 驗證碼文字,默認是8位隨機字符串         \r\n 'word' => 'Random word',         \r\n \/\/ 圖片保存路徑         \r\n 'img_path' => '.\/captcha\/',         \r\n \/\/ 基礎目錄URL         \r\n 'img_url' => base_url() . '.\/captcha',         \r\n \/\/ 圖片中的字體使用的字體文件         \r\n 'font_path' => '.\/path\/to\/fonts\/texb.ttf',         \r\n \/\/ 圖片大小         \r\n 'img_width' => '150',         \r\n 'img_height' => 30,         \r\n \/\/ 指定了驗證碼圖片的超時刪除時間(秒),默認2小時         \r\n 'expiration' => 30     ); \r\n $cap = create_captcha($vals);<\/pre><p>此外,還可以設置字符串長度、顏色、字體大小、可選字符,返回值包括了生成圖片的名稱、完整的img標簽、驗證碼字符串<br\/><br\/>由于CI不是PHP的session,因此對于驗證碼的驗證過程可以直接使用PHP的session進行保存<br\/><br\/><\/p><pre class='brush:php;toolbar:false;'>[code]session_start(); $_SESSION['cap'] = $cap['word'];<\/pre><p>然后使用用戶的輸入與session中的值進行比較就可以了<br><\/p>\n<p>?以上就是CodeIgniter學習筆記 Item6--CI中的常規(guī)主題的內容,更多相關內容請關注PHP中文網(www.miracleart.cn)!<br><\/p>\n<p><br><\/p>"}	</script>
      	
      <meta http-equiv="Cache-Control" content="no-transform" />
      <meta http-equiv="Cache-Control" content="no-siteapp" />
      <script>var V_PATH="/";window.onerror=function(){ return true; };</script>
      </head>
      
      <body data-commit-time="2023-12-28T14:50:12+08:00" class="editor_body body2_2">
      	<link rel="stylesheet" type="text/css" href="/static/csshw/stylehw.css">
      <header>
          <div   id="377j5v51b"   class="head">
              <div   id="377j5v51b"   class="haed_left">
                  <div   id="377j5v51b"   class="haed_logo">
                      <a href="http://www.miracleart.cn/" title="" class="haed_logo_a">
                          <img src="/static/imghw/logo.png" alt="" class="haed_logoimg">
                      </a>
                  </div>
                  <div   id="377j5v51b"   class="head_nav">
                      <div   id="377j5v51b"   class="head_navs">
                          <a href="javascript:;" title="Community" class="head_nava head_nava-template1">Community</a>
                          <div   class="377j5v51b"   id="dropdown-template1" style="display: none;">
                              <div   id="377j5v51b"   class="languagechoose">
                                  <a href="http://www.miracleart.cn/article.html" title="Articles" class="languagechoosea on">Articles</a>
                                  <a href="http://www.miracleart.cn/faq/zt" title="Topics" class="languagechoosea">Topics</a>
                                  <a href="http://www.miracleart.cn/wenda.html" title="Q&A" class="languagechoosea">Q&A</a>
                              </div>
                          </div>
                      </div>
      
                      <div   id="377j5v51b"   class="head_navs">
                          <a href="javascript:;" title="Learn" class="head_nava head_nava-template1_1">Learn</a>
                          <div   class="377j5v51b"   id="dropdown-template1_1" style="display: none;">
                              <div   id="377j5v51b"   class="languagechoose">
                                  <a href="http://www.miracleart.cn/course.html" title="Course" class="languagechoosea on">Course</a>
                                  <a href="http://www.miracleart.cn/dic/" title="Programming Dictionary" class="languagechoosea">Programming Dictionary</a>
                              </div>
                          </div>
                      </div>
      
                      <div   id="377j5v51b"   class="head_navs">
                          <a href="javascript:;" title="Tools Library" class="head_nava head_nava-template1_2">Tools Library</a>
                          <div   class="377j5v51b"   id="dropdown-template1_2" style="display: none;">
                              <div   id="377j5v51b"   class="languagechoose">
                                  <a href="http://www.miracleart.cn/toolset/development-tools" title="Development tools" class="languagechoosea on">Development tools</a>
                                  <a href="http://www.miracleart.cn/toolset/website-source-code" title="Website Source Code" class="languagechoosea">Website Source Code</a>
                                  <a href="http://www.miracleart.cn/toolset/php-libraries" title="PHP Libraries" class="languagechoosea">PHP Libraries</a>
                                  <a href="http://www.miracleart.cn/toolset/js-special-effects" title="JS special effects" class="languagechoosea on">JS special effects</a>
                                  <a href="http://www.miracleart.cn/toolset/website-materials" title="Website Materials" class="languagechoosea on">Website Materials</a>
                                  <a href="http://www.miracleart.cn/toolset/extension-plug-ins" title="Extension plug-ins" class="languagechoosea on">Extension plug-ins</a>
                              </div>
                          </div>
                      </div>
      
                      <div   id="377j5v51b"   class="head_navs">
                          <a href="http://www.miracleart.cn/ai" title="AI Tools" class="head_nava head_nava-template1_3">AI Tools</a>
                      </div>
      
                      <div   id="377j5v51b"   class="head_navs">
                          <a href="javascript:;" title="Leisure" class="head_nava head_nava-template1_3">Leisure</a>
                          <div   class="377j5v51b"   id="dropdown-template1_3" style="display: none;">
                              <div   id="377j5v51b"   class="languagechoose">
                                  <a href="http://www.miracleart.cn/game" title="Game Download" class="languagechoosea on">Game Download</a>
                                  <a href="http://www.miracleart.cn/mobile-game-tutorial/" title="Game Tutorials" class="languagechoosea">Game Tutorials</a>
      
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
                          <div   id="377j5v51b"   class="head_search">
                      <input id="key_words"  onkeydown="if (event.keyCode == 13) searchs('en')" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="">
                      <a href="javascript:;" title="search"  onclick="searchs('en')"><img src="/static/imghw/find.png" alt="search"></a>
                  </div>
                      <div   id="377j5v51b"   class="head_right">
                  <div   id="377j5v51b"   class="haed_language">
                      <a href="javascript:;" class="layui-btn haed_language_btn">English<i class="layui-icon layui-icon-triangle-d"></i></a>
                      <div   class="377j5v51b"   id="dropdown-template" style="display: none;">
                          <div   id="377j5v51b"   class="languagechoose">
                                                      <a href="javascript:setlang('zh-cn');" title="簡體中文" class="languagechoosea">簡體中文</a>
                                                      <a href="javascript:;" title="English" class="languagechoosea">English</a>
                                                      <a href="javascript:setlang('zh-tw');" title="繁體中文" class="languagechoosea">繁體中文</a>
                                                      <a href="javascript:setlang('ja');" title="日本語" class="languagechoosea">日本語</a>
                                                      <a href="javascript:setlang('ko');" title="???" class="languagechoosea">???</a>
                                                      <a href="javascript:setlang('ms');" title="Melayu" class="languagechoosea">Melayu</a>
                                                      <a href="javascript:setlang('fr');" title="Fran?ais" class="languagechoosea">Fran?ais</a>
                                                      <a href="javascript:setlang('de');" title="Deutsch" class="languagechoosea">Deutsch</a>
                                                  </div>
                      </div>
                  </div>
                  <span id="377j5v51b"    class="head_right_line"></span>
                                  <div style="display: block;" id="login" class="haed_login ">
                          <a href="javascript:;"  title="Login" class="haed_logina ">Login</a>
                      </div>
                      <div style="display: block;" id="reg" class="head_signup login">
                          <a href="javascript:;"  title="singup" class="head_signupa">singup</a>
                      </div>
                  
              </div>
          </div>
      </header>
      
      	
      	<main>
      		<div   id="377j5v51b"   class="Article_Details_main">
      			<div   id="377j5v51b"   class="Article_Details_main1">
      							<div   id="377j5v51b"   class="Article_Details_main1M">
      					<div   id="377j5v51b"   class="phpgenera_Details_mainL1">
      						<a href="http://www.miracleart.cn/" title="Home"
      							class="phpgenera_Details_mainL1a">Home</a>
      						<img src="/static/imghw/top_right.png" alt="" />
      												<a href="http://www.miracleart.cn/php-tutorials.html"
      							class="phpgenera_Details_mainL1a">php教程</a>
      						<img src="/static/imghw/top_right.png" alt="" />
      												<a href="http://www.miracleart.cn/php-ercikaifa.html"
      							class="phpgenera_Details_mainL1a">PHP開發(fā)</a>
      						<img src="/static/imghw/top_right.png" alt="" />
      						<span>CodeIgniter study notes Item6--General topics in CI</span>
      					</div>
      					
      					<div   id="377j5v51b"   class="Articlelist_txts">
      						<div   id="377j5v51b"   class="Articlelist_txts_info">
      							<h1 class="Articlelist_txts_title">CodeIgniter study notes Item6--General topics in CI</h1>
      							<div   id="377j5v51b"   class="Articlelist_txts_info_head">
      								<div   id="377j5v51b"   class="author_info">
      									<a href="http://www.miracleart.cn/member/194.html"  class="author_avatar">
      									<img class="lazy"  data-src="https://img.php.cn/upload/avatar/000/000/194/591128da2963a284.jpg" src="/static/imghw/default1.png" alt="黃舟">
      									</a>
      									<div   id="377j5v51b"   class="author_detail">
      																			<a href="http://www.miracleart.cn/member/194.html" class="author_name">黃舟</a>
                                      										</div>
      								</div>
                      			</div>
      							<span id="377j5v51b"    class="Articlelist_txts_time">Dec 29, 2016 am	 10:30 AM</span>
      														
      						</div>
      					</div>
      					<hr />
      					<div   id="377j5v51b"   class="article_main php-article">
      						<div   id="377j5v51b"   class="article-list-left detail-content-wrap content">
      						<ins class="adsbygoogle"
      							style="display:block; text-align:center;"
      							data-ad-layout="in-article"
      							data-ad-format="fluid"
      							data-ad-client="ca-pub-5902227090019525"
      							data-ad-slot="3461856641">
      						</ins>
      						
      
      					<p style=";font-family: 'Microsoft YaHei';font-weight: bolder;line-height: 18px;color: rgb(85, 85, 85);text-rendering: optimizeLegibility;font-size: 18px;padding: 10px 20px 9px 10px;border-left: 4px solid rgb(0, 166, 124);background-color: rgb(251, 251, 251);white-space: normal">1. 擴展控制器</p>
      <p>CI的控制器默認繼承自CI_Controller<br>,如果要擴展控制器,需要定義一個從CI_Controller<br>派生的控制器,所有的自定義控制器都繼承這個新控制器。<br><br>在application/core目錄下,有與system目錄下類似的目錄結構,比如core、helpers、language、libraries目錄,擴展控制器就是在application/core目錄下自定義控制器,該控制器類從CI_Controller繼承,類似的,如果要擴展系統(tǒng)的功能,就在application下的對應目錄新增自定義類,從系統(tǒng)類繼承。<br></p><pre class='brush:php;toolbar:false;'>
      [code]<?php     
      class My_Controller extends CI_Controller     
      
      {             
      function __construct()         
      {             
      parent::__construct();             
      echo "自定義控制器";             
      // 權限驗證...             
      // 登錄驗證...         
      }    
       } 
       ?></pre><p><br/>之后,將所有添加的控制器都從MY_Controller<br/>派生,通過在MY_Controller<br/>中重寫父類方法來實現(xiàn)擴展控制器。<br/><br/>在application/config/config.php文件中,有這樣一個配置項<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$config[&#39;subclass_prefix&#39;] = &#39;MY_&#39;;</pre><p>CI在查找擴展類,會根據這里的前綴去查找并包含定義類文件,此處前綴不區(qū)分大小寫<br/><br/></p><p>2. CI中的URL</p><p>當PHP程序部署在服務器上時,用戶會將程序安裝到指定目錄,程序員無法預先知道用戶會安裝到哪個目錄,因此對于代碼中出現(xiàn)的URL不能寫死,需要通過URL輔助函數(shù)動態(tài)獲取,在使用函數(shù)前需要先加載URL輔助函數(shù)庫($this->load->helper('url'))<br/>或配置/application/config/autoload.php自動加載。<br/><br/>site_url()<br/>:返回以config.php中指定的base_url<br/>和index.php,還有傳遞給函數(shù)的URL段參數(shù)拼接成的字符串<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]<!DOCTYPE html>
       <html> 
       <head>    
       <meta charset="UTF-8">     
       <title>Document</title> 
       </head> 
       <body>     
       <form action=<?php echo site_url(&#39;user/index4&#39;); ?> method="post">         
       name:<input type="text" name="name" /><br />         
       password:<input type="text" name="password"><br />         
       <input type="submit" name="submit" value="submit" />     
       </form> 
       </body> 
       </html></pre><p>base_url():返回項目的基礎目錄<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]<img src="<?php echo base_url(); ?>upload/qe.jpg"></pre><p>current_url():返回當前查看頁面的完整URL<br/><br/></p><p>3.CI中的路由</p><p>路由用于配置針對某些URL與項目中實際文件的對應關系,是的URL看起來更符合用戶的習慣,又不用改變項目現(xiàn)有的結構,路由的配置文件是/application/config/routes.php,可以設置默認控制器和404錯誤頁面<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$route[&#39;default_controller&#39;] = &#39;welcome&#39;; $route[&#39;404_override&#39;] = &#39;&#39;;</pre><p>更重要的功能是,如果我們要實現(xiàn)通過/index.php/news/4.html訪問/index.php/article/show/1這樣一個需求,可以在routes.php定義路由關系,將原始的URL轉換成需要樣式<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$route[&#39;news/([\d]+)\.html] = &#39;article/show/$1&#39;;</pre><p>這樣對于所有負責正則表達式的URL,都會路由到新的路徑,其中$1<br/>表示正則表達式中的第一個 <br/><br/>用()括起來的部分<br/><br/></p><p>4.CI中的分頁</p><p>首先加載分頁類<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->load->library(&#39;pagination&#39;);</pre><p>然后設置分頁屬性<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]// 每頁顯示的數(shù)量 
      $config[&#39;page_size&#39;] = 10; 
      // 總數(shù)據量 
      $config[&#39;total_rows&#39;] = 200; 
      // 設置分頁跳轉頁面的基礎地址 
      $config[&#39;base_url&#39;] = site_url(&#39;index.php/user/test&#39;); 
      // 設置分頁顯示文字 
      $config[&#39;first_link&#39;] = &#39;首頁&#39;; 
      $config[&#39;next_link&#39;] = &#39;下一頁&#39;; 
      $config[&#39;prev_link&#39;] = &#39;上一頁&#39;; 
      $config[&#39;last_link&#39;] = &#39;末頁&#39;;</pre><p>初始化分頁類<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->pagination->initialize($config);</pre><p>創(chuàng)建鏈接并傳遞給視圖<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$data[&#39;links&#39;] = $this->pagination->create_links(); $this->load->view(&#39;test&#39;, $data);</pre><p>通過URL獲取偏移量拼裝查詢<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$offset = (int)$this->load->uri->segment(3); $sql = "SELECT * FROM blog_user limit $offset, $page_size";</pre><p>5.CI中的文件上傳</p><p>首先通過控制器的方法跳轉至視圖<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]public function file() {     $this->load->helper(&#39;url&#39;);     $this->load->view(&#39;file&#39;); }</pre><p>在視圖中創(chuàng)建一個表單用于選擇并上傳文件<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]<!DOCTYPE html> 
      <html> 
      <head>     
      <meta charset="UTF-8">     
      <title>Document</title> 
      </head> 
      <body>     
      <form action="<?php echo site_url(&#39;index.php/user/upload&#39;); ?>" method="post" enctype="multipart/form-data">         
      <input type="file" name="pic" />         
      <input type="submit" name="submit" value="submit">     
      </form> 
      </body> 
      </html></pre><p>其中,要注意第一個input的name屬性,這個屬性后面要用,在表單中將action設置為一個控制器方法,編寫對應的控制器方法<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]
      public function upload() 
      {     
      // 上傳文件到服務器目錄     
      $config[&#39;upload_path&#39;] = &#39;./upload&#39;;     
      // 允許上傳哪些類型     
      $config[&#39;allowed_types&#39;] = &#39;gif|png|jpg|jpeg&#39;;     
      // 上傳后的文件名,用uniqid()保證文件名唯一     
      $config[&#39;file_name&#39;] = uniqid();     
      // 加載上傳庫     
      $this->load->library(&#39;upload&#39;, $config);     
      // 上傳文件,這里的pic是視圖中file控件的name屬性     
      $result = $this->upload->do_upload(&#39;pic&#39;);     
      // 如果上傳成功,獲取上傳文件的信息     
      if ($result)      
      {         
      var_dump($this->upload->data());     
      } 
      }</pre><p>這樣就完成文件上傳了<br/><br/></p><p>6.CI中的Session</p><p>CI默認沒有啟動Session,而是用Cookie代替Session,首先Cookie只能保存4KB的數(shù)據,其次,在Session中保存數(shù)據馬上就可以獲取到,而Cookie中的數(shù)據要等到下次客戶端請求時才能獲取到。<br/><br/>首先加載Session類<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->load->library(&#39;session&#39;);</pre><p>然后通過set_userdata方法以鍵值對或關聯(lián)數(shù)組的方式保存數(shù)據<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$user = array(&#39;id&#39; => 3, &#39;name&#39;=>&#39;dj&#39;); $this->session->set_userdata(&#39;user&#39;, $user);</pre><p>用userdata方法獲取數(shù)據<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$user = $this->session->userdata(&#39;user&#39;);</pre><p>用unset_userdata方法刪除數(shù)據<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->session->unset_userdata(&#39;user&#39;);</pre><p>如果要保存的數(shù)據只需要用一次,可以使用閃出數(shù)據,這種數(shù)據只對下次服務器請求可用,然后會自動清除,閃出數(shù)據用set_flashdata()方法設置<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->session->set_flashdata(&#39;user&#39;, $user);</pre><p>7.CI中的驗證碼</p><p>首先需要在入口文件的同級目錄文件夾用于保存驗證碼圖片,比如新建captcha目錄<br/><br/>加載captcha輔助類<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->load->helper(&#39;captcha&#39;);</pre><p>調用create_captcha函數(shù)生成驗證碼圖片<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]$this->load->helper(&#39;url&#39;); 
      $vals = array     
      (        
       // 驗證碼文字,默認是8位隨機字符串         
       &#39;word&#39; => &#39;Random word&#39;,         
       // 圖片保存路徑         
       &#39;img_path&#39; => &#39;./captcha/&#39;,         
       // 基礎目錄URL         
       &#39;img_url&#39; => base_url() . &#39;./captcha&#39;,         
       // 圖片中的字體使用的字體文件         
       &#39;font_path&#39; => &#39;./path/to/fonts/texb.ttf&#39;,         
       // 圖片大小         
       &#39;img_width&#39; => &#39;150&#39;,         
       &#39;img_height&#39; => 30,         
       // 指定了驗證碼圖片的超時刪除時間(秒),默認2小時         
       &#39;expiration&#39; => 30     ); 
       $cap = create_captcha($vals);</pre><p>此外,還可以設置字符串長度、顏色、字體大小、可選字符,返回值包括了生成圖片的名稱、完整的img標簽、驗證碼字符串<br/><br/>由于CI不是PHP的session,因此對于驗證碼的驗證過程可以直接使用PHP的session進行保存<br/><br/></p><pre class='brush:php;toolbar:false;'>[code]session_start(); $_SESSION[&#39;cap&#39;] = $cap[&#39;word&#39;];</pre><p>然后使用用戶的輸入與session中的值進行比較就可以了<br></p>
      <p>?以上就是CodeIgniter學習筆記 Item6--CI中的常規(guī)主題的內容,更多相關內容請關注PHP中文網(www.miracleart.cn)!<br></p>
      <p><br></p>
      
      
      						</div>
      					</div>
      					<div   id="377j5v51b"   class="wzconShengming_sp">
      						<div   id="377j5v51b"   class="bzsmdiv_sp">Statement of this Website</div>
      						<div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div>
      					</div>
      				</div>
      
      				<ins class="adsbygoogle"
           style="display:block"
           data-ad-format="autorelaxed"
           data-ad-client="ca-pub-5902227090019525"
           data-ad-slot="2507867629"></ins>
      
      
      
      				<div   id="377j5v51b"   class="AI_ToolDetails_main4sR">
      
      
      				<ins class="adsbygoogle"
              style="display:block"
              data-ad-client="ca-pub-5902227090019525"
              data-ad-slot="3653428331"
              data-ad-format="auto"
              data-full-width-responsive="true"></ins>
          
      
      
      					<!-- <div   id="377j5v51b"   class="phpgenera_Details_mainR4">
      						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
      							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
      								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									src="/static/imghw/hotarticle2.png" alt="" />
      								<h2>Hot Article</h2>
      							</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796832397.html" title="Grass Wonder Build Guide | Uma Musume Pretty Derby" class="phpgenera_Details_mainR4_bottom_title">Grass Wonder Build Guide | Uma Musume Pretty Derby</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796833110.html" title="Roblox: 99 Nights In The Forest - All Badges And How To Unlock Them" class="phpgenera_Details_mainR4_bottom_title">Roblox: 99 Nights In The Forest - All Badges And How To Unlock Them</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>4 weeks ago</span>
      										<span>By DDD</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796831605.html" title="Uma Musume Pretty Derby Banner Schedule (July 2025)" class="phpgenera_Details_mainR4_bottom_title">Uma Musume Pretty Derby Banner Schedule (July 2025)</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796836699.html" title="RimWorld Odyssey Temperature Guide for Ships and Gravtech" class="phpgenera_Details_mainR4_bottom_title">RimWorld Odyssey Temperature Guide for Ships and Gravtech</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>3 weeks ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796831905.html" title="Windows Security is blank or not showing options" class="phpgenera_Details_mainR4_bottom_title">Windows Security is blank or not showing options</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By 下次還敢</span>
      									</div>
      								</div>
      														</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
      								<a href="http://www.miracleart.cn/article.html">Show More</a>
      							</div>
      						</div>
      					</div> -->
      
      
      											<div   id="377j5v51b"   class="phpgenera_Details_mainR3">
      							<div   id="377j5v51b"   class="phpmain1_4R_readrank">
      								<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/hottools2.png" alt="" />
      									<h2>Hot AI Tools</h2>
      								</div>
      								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_bottom">
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title">
      													<h3>Undress AI Tool</h3>
      												</a>
      												<p>Undress images for free</p>
      											</div>
      										</div>
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title">
      													<h3>Undresser.AI Undress</h3>
      												</a>
      												<p>AI-powered app for creating realistic nude photos</p>
      											</div>
      										</div>
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title">
      													<h3>AI Clothes Remover</h3>
      												</a>
      												<p>Online AI tool for removing clothes from photos.</p>
      											</div>
      										</div>
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title">
      													<h3>Clothoff.io</h3>
      												</a>
      												<p>AI clothes remover</p>
      											</div>
      										</div>
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173414504068133.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Video Face Swap" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_title">
      													<h3>Video Face Swap</h3>
      												</a>
      												<p>Swap faces in any video effortlessly with our completely free AI face swap tool!</p>
      											</div>
      										</div>
      																</div>
      								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
      									<a href="http://www.miracleart.cn/ai">Show More</a>
      								</div>
      							</div>
      						</div>
      					
      
      
      					<div   id="377j5v51b"   class="phpgenera_Details_mainR4">
      						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
      							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
      								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									src="/static/imghw/hotarticle2.png" alt="" />
      								<h2>Hot Article</h2>
      							</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796832397.html" title="Grass Wonder Build Guide | Uma Musume Pretty Derby" class="phpgenera_Details_mainR4_bottom_title">Grass Wonder Build Guide | Uma Musume Pretty Derby</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796833110.html" title="Roblox: 99 Nights In The Forest - All Badges And How To Unlock Them" class="phpgenera_Details_mainR4_bottom_title">Roblox: 99 Nights In The Forest - All Badges And How To Unlock Them</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>4 weeks ago</span>
      										<span>By DDD</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796831605.html" title="Uma Musume Pretty Derby Banner Schedule (July 2025)" class="phpgenera_Details_mainR4_bottom_title">Uma Musume Pretty Derby Banner Schedule (July 2025)</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796836699.html" title="RimWorld Odyssey Temperature Guide for Ships and Gravtech" class="phpgenera_Details_mainR4_bottom_title">RimWorld Odyssey Temperature Guide for Ships and Gravtech</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>3 weeks ago</span>
      										<span>By Jack chen</span>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/1796831905.html" title="Windows Security is blank or not showing options" class="phpgenera_Details_mainR4_bottom_title">Windows Security is blank or not showing options</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<span>1 months ago</span>
      										<span>By 下次還敢</span>
      									</div>
      								</div>
      														</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
      								<a href="http://www.miracleart.cn/article.html">Show More</a>
      							</div>
      						</div>
      					</div>
      
      
      											<div   id="377j5v51b"   class="phpgenera_Details_mainR3">
      							<div   id="377j5v51b"   class="phpmain1_4R_readrank">
      								<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/hottools2.png" alt="" />
      									<h2>Hot Tools</h2>
      								</div>
      								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_bottom">
      																		<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Notepad++7.3.1" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/toolset/development-tools/92" title="Notepad++7.3.1" class="phpmain_tab2_mids_title">
      													<h3>Notepad++7.3.1</h3>
      												</a>
      												<p>Easy-to-use and free code editor</p>
      											</div>
      										</div>
      																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Chinese version" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/toolset/development-tools/93" title="SublimeText3 Chinese version" class="phpmain_tab2_mids_title">
      													<h3>SublimeText3 Chinese version</h3>
      												</a>
      												<p>Chinese version, very easy to use</p>
      											</div>
      										</div>
      																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Zend Studio 13.0.1" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/toolset/development-tools/121" title="Zend Studio 13.0.1" class="phpmain_tab2_mids_title">
      													<h3>Zend Studio 13.0.1</h3>
      												</a>
      												<p>Powerful PHP integrated development environment</p>
      											</div>
      										</div>
      																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title">
      													<h3>Dreamweaver CS6</h3>
      												</a>
      												<p>Visual web development tools</p>
      											</div>
      										</div>
      																			<div   id="377j5v51b"   class="phpmain_tab2_mids_top">
      											<a href="http://www.miracleart.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_top_img">
      												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac version" />
      											</a>
      											<div   id="377j5v51b"   class="phpmain_tab2_mids_info">
      												<a href="http://www.miracleart.cn/toolset/development-tools/500" title="SublimeText3 Mac version" class="phpmain_tab2_mids_title">
      													<h3>SublimeText3 Mac version</h3>
      												</a>
      												<p>God-level code editing software (SublimeText3)</p>
      											</div>
      										</div>
      																	</div>
      								<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
      									<a href="http://www.miracleart.cn/ai">Show More</a>
      								</div>
      							</div>
      						</div>
      										
      
      					
      					<div   id="377j5v51b"   class="phpgenera_Details_mainR4">
      						<div   id="377j5v51b"   class="phpmain1_4R_readrank">
      							<div   id="377j5v51b"   class="phpmain1_4R_readrank_top">
      								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      									src="/static/imghw/hotarticle2.png" alt="" />
      								<h2>Hot Topics</h2>
      							</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottom">
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/laravel-tutori" title="Laravel Tutorial" class="phpgenera_Details_mainR4_bottom_title">Laravel Tutorial</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
      											<img src="/static/imghw/eyess.png" alt="" />
      											<span>1600</span>
      										</div>
      										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
      											<img src="/static/imghw/tiezi.png" alt="" />
      											<span>29</span>
      										</div>
      									</div>
      								</div>
      															<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms">
      									<a href="http://www.miracleart.cn/faq/php-tutorial" title="PHP Tutorial" class="phpgenera_Details_mainR4_bottom_title">PHP Tutorial</a>
      									<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_info">
      										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
      											<img src="/static/imghw/eyess.png" alt="" />
      											<span>1502</span>
      										</div>
      										<div   id="377j5v51b"   class="phpgenera_Details_mainR4_bottoms_infos">
      											<img src="/static/imghw/tiezi.png" alt="" />
      											<span>276</span>
      										</div>
      									</div>
      								</div>
      														</div>
      							<div   id="377j5v51b"   class="phpgenera_Details_mainR3_more">
      								<a href="http://www.miracleart.cn/faq/zt">Show More</a>
      							</div>
      						</div>
      					</div>
      				</div>
      			</div>
      							<div   id="377j5v51b"   class="Article_Details_main2">
      					<div   id="377j5v51b"   class="phpgenera_Details_mainL4">
      						<div   id="377j5v51b"   class="phpmain1_2_top">
      							<a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img
      									src="/static/imghw/index2_title2.png" alt="" /></a>
      						</div>
      						<div   id="377j5v51b"   class="phpgenera_Details_mainL4_info">
      
      													<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/584862.html" title="How to implement custom middleware in CodeIgniter" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/169059920353285.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to implement custom middleware in CodeIgniter" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/584862.html" title="How to implement custom middleware in CodeIgniter" class="phphistorical_Version2_mids_title">How to implement custom middleware in CodeIgniter</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jul 29, 2023 am	 10:53 AM</span>
      								<p class="Articlelist_txts_p">How to implement custom middleware in CodeIgniter Introduction: In modern web development, middleware plays a vital role in applications. They can be used to perform some shared processing logic before or after the request reaches the controller. CodeIgniter, as a popular PHP framework, also supports the use of middleware. This article will introduce how to implement custom middleware in CodeIgniter and provide a simple code example. Middleware overview: Middleware is a kind of request</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/584549.html" title="CodeIgniter middleware: Accelerate application responsiveness and page rendering" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/169054149788499.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CodeIgniter middleware: Accelerate application responsiveness and page rendering" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/584549.html" title="CodeIgniter middleware: Accelerate application responsiveness and page rendering" class="phphistorical_Version2_mids_title">CodeIgniter middleware: Accelerate application responsiveness and page rendering</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jul 28, 2023 pm	 06:51 PM</span>
      								<p class="Articlelist_txts_p">CodeIgniter Middleware: Accelerating Application Responsiveness and Page Rendering Overview: As web applications continue to grow in complexity and interactivity, developers need to use more efficient and scalable solutions to improve application performance and responsiveness. . CodeIgniter (CI) is a lightweight PHP-based framework that provides many useful features, one of which is middleware. Middleware is a series of tasks that are performed before or after the request reaches the controller. This article will introduce how to use</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/584693.html" title="How to use the database query builder (Query Builder) in the CodeIgniter framework" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/169055720230920.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to use the database query builder (Query Builder) in the CodeIgniter framework" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/584693.html" title="How to use the database query builder (Query Builder) in the CodeIgniter framework" class="phphistorical_Version2_mids_title">How to use the database query builder (Query Builder) in the CodeIgniter framework</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jul 28, 2023 pm	 11:13 PM</span>
      								<p class="Articlelist_txts_p">Introduction to the method of using the database query builder (QueryBuilder) in the CodeIgniter framework: CodeIgniter is a lightweight PHP framework that provides many powerful tools and libraries to facilitate developers in web application development. One of the most impressive features is the database query builder (QueryBuilder), which provides a concise and powerful way to build and execute database query statements. This article will introduce how to use Co</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/560622.html" title="PHP development: Using CodeIgniter to implement MVC pattern and RESTful API" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/000/164/168687416552799.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP development: Using CodeIgniter to implement MVC pattern and RESTful API" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/560622.html" title="PHP development: Using CodeIgniter to implement MVC pattern and RESTful API" class="phphistorical_Version2_mids_title">PHP development: Using CodeIgniter to implement MVC pattern and RESTful API</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jun 16, 2023 am	 08:09 AM</span>
      								<p class="Articlelist_txts_p">As web applications continue to evolve, it is important to develop applications more quickly and efficiently. And, as RESTful API is widely used in web applications, it is necessary for developers to understand how to create and implement RESTful API. In this article, we will discuss how to implement MVC pattern and RESTful API using CodeIgniter framework. Introduction to MVC pattern MVC (Model-Vie</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/568074.html" title="Use PHP framework CodeIgniter to develop a real-time chat application to provide convenient communication services" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/000/164/168784857095003.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="Use PHP framework CodeIgniter to develop a real-time chat application to provide convenient communication services" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/568074.html" title="Use PHP framework CodeIgniter to develop a real-time chat application to provide convenient communication services" class="phphistorical_Version2_mids_title">Use PHP framework CodeIgniter to develop a real-time chat application to provide convenient communication services</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jun 27, 2023 pm	 02:49 PM</span>
      								<p class="Articlelist_txts_p">With the development of mobile Internet, instant messaging has become more and more important and popular. For many companies, live chat is more like a communication service, providing a convenient communication method that can quickly and effectively solve business problems. Based on this, this article will introduce how to use the PHP framework CodeIgniter to develop a real-time chat application. Understand the CodeIgniter framework CodeIgniter is a lightweight PHP framework that provides a series of simple tools and libraries to help developers quickly</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/553472.html" title="How to use CodeIgniter5 framework in php?" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/202306/01/2023060111211876729.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="How to use CodeIgniter5 framework in php?" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/553472.html" title="How to use CodeIgniter5 framework in php?" class="phphistorical_Version2_mids_title">How to use CodeIgniter5 framework in php?</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jun 01, 2023 am	 11:21 AM</span>
      								<p class="Articlelist_txts_p">CodeIgniter is a lightweight PHP framework that uses MVC architecture to support rapid development and simplify common tasks. CodeIgniter5 is the latest version of the framework and offers many new features and improvements. This article will introduce how to use the CodeIgniter5 framework to build a simple web application. Step 1: Install CodeIgniter5 Downloading and installing CodeIgniter5 is very simple, just follow these steps: Download the latest version</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/586673.html" title="CodeIgniter middleware: Provides secure file upload and download functions" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/465/014/169087328818794.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="CodeIgniter middleware: Provides secure file upload and download functions" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/586673.html" title="CodeIgniter middleware: Provides secure file upload and download functions" class="phphistorical_Version2_mids_title">CodeIgniter middleware: Provides secure file upload and download functions</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Aug 01, 2023 pm	 03:01 PM</span>
      								<p class="Articlelist_txts_p">CodeIgniter middleware: Provides secure file upload and download functions Introduction: In the process of web application development, file upload and download are very common functions. However, for security reasons, handling file uploads and downloads often requires additional security measures. CodeIgniter is a popular PHP framework that provides a wealth of tools and libraries to support developers in building secure and reliable web applications. This article will introduce how to use CodeIgniter middleware to implement secure files</p>
      							</div>
      														<div   id="377j5v51b"   class="phphistorical_Version2_mids">
      								<a href="http://www.miracleart.cn/faq/562269.html" title="PHP Implementation Framework: CodeIgniter Getting Started Tutorial" class="phphistorical_Version2_mids_img">
      									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
      										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/000/887/227/168709943910893.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP Implementation Framework: CodeIgniter Getting Started Tutorial" />
      								</a>
      								<a href="http://www.miracleart.cn/faq/562269.html" title="PHP Implementation Framework: CodeIgniter Getting Started Tutorial" class="phphistorical_Version2_mids_title">PHP Implementation Framework: CodeIgniter Getting Started Tutorial</a>
      								<span id="377j5v51b"    class="Articlelist_txts_time">Jun 18, 2023 pm	 10:43 PM</span>
      								<p class="Articlelist_txts_p">In recent years, the advancement of Web development technology and the continuous expansion of global Internet applications have made PHP technology more and more widely used. As a rapidly developing technology, its ecosystem continues to grow. Among them, CodeIgniter, as one of the famous frameworks in the field of PHP development, is very popular among many developers. This article will introduce the relevant knowledge of the CodeIgniter framework to provide an introductory guide for beginners. 1. What is the CodeIgniter framework? CodeIg</p>
      							</div>
      													</div>
      
      													<a href="http://www.miracleart.cn/php-tutorials.html" class="phpgenera_Details_mainL4_botton">
      								<span>See all articles</span>
      								<img src="/static/imghw/down_right.png" alt="" />
      							</a>
      											</div>
      				</div>
      					</div>
      	</main>
      	<footer>
          <div   id="377j5v51b"   class="footer">
              <div   id="377j5v51b"   class="footertop">
                  <img src="/static/imghw/logo.png" alt="">
                  <p>Public welfare online PHP training,Help PHP learners grow quickly!</p>
              </div>
              <div   id="377j5v51b"   class="footermid">
                  <a href="http://www.miracleart.cn/about/us.html">About us</a>
                  <a href="http://www.miracleart.cn/about/disclaimer.html">Disclaimer</a>
                  <a href="http://www.miracleart.cn/update/article_0_1.html">Sitemap</a>
              </div>
              <div   id="377j5v51b"   class="footerbottom">
                  <p>
                      ? php.cn All rights reserved
                  </p>
              </div>
          </div>
      </footer>
      
      <input type="hidden" id="verifycode" value="/captcha.html">
      
      
      
      
      		<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' />
      	
      	
      	
      	
      	
      
      	
      	
      
      
      
      
      
      
      <footer>
      <div class="friendship-link">
      <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p>
      <a href="http://www.miracleart.cn/" title="国产av日韩一区二区三区精品">国产av日韩一区二区三区精品</a>
      
      <div class="friend-links">
      
      
      </div>
      </div>
      
      </footer>
      
      
      <script>
      (function(){
          var bp = document.createElement('script');
          var curProtocol = window.location.protocol.split(':')[0];
          if (curProtocol === 'https') {
              bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
          }
          else {
              bp.src = 'http://push.zhanzhang.baidu.com/push.js';
          }
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(bp, s);
      })();
      </script>
      </body><div id="kgdz8" class="pl_css_ganrao" style="display: none;"><nobr id="kgdz8"></nobr><delect id="kgdz8"><small id="kgdz8"><ins id="kgdz8"></ins></small></delect><font id="kgdz8"><object id="kgdz8"></object></font><strike id="kgdz8"><button id="kgdz8"><form id="kgdz8"></form></button></strike><dfn id="kgdz8"><em id="kgdz8"><pre id="kgdz8"></pre></em></dfn><td id="kgdz8"><form id="kgdz8"><p id="kgdz8"></p></form></td><menuitem id="kgdz8"></menuitem><dfn id="kgdz8"></dfn><thead id="kgdz8"></thead><em id="kgdz8"></em><kbd id="kgdz8"></kbd><video id="kgdz8"><sup id="kgdz8"><th id="kgdz8"></th></sup></video><tr id="kgdz8"></tr><em id="kgdz8"><input id="kgdz8"></input></em><button id="kgdz8"></button><ol id="kgdz8"><small id="kgdz8"></small></ol><legend id="kgdz8"><ruby id="kgdz8"></ruby></legend><strike id="kgdz8"><video id="kgdz8"><sup id="kgdz8"><b id="kgdz8"></b></sup></video></strike><em id="kgdz8"></em><em id="kgdz8"><s id="kgdz8"><form id="kgdz8"></form></s></em><style id="kgdz8"></style><ul id="kgdz8"><strike id="kgdz8"><video id="kgdz8"><strike id="kgdz8"></strike></video></strike></ul><progress id="kgdz8"><dfn id="kgdz8"><span id="kgdz8"><noframes id="kgdz8"></noframes></span></dfn></progress><dfn id="kgdz8"></dfn><tbody id="kgdz8"><strike id="kgdz8"></strike></tbody><dfn id="kgdz8"><em id="kgdz8"><pre id="kgdz8"><b id="kgdz8"></b></pre></em></dfn><strong id="kgdz8"><mark id="kgdz8"><listing id="kgdz8"></listing></mark></strong><bdo id="kgdz8"></bdo><nav id="kgdz8"><center id="kgdz8"><optgroup id="kgdz8"><meter id="kgdz8"></meter></optgroup></center></nav><span id="kgdz8"><small id="kgdz8"><strike id="kgdz8"></strike></small></span><font id="kgdz8"></font><font id="kgdz8"></font><thead id="kgdz8"></thead><listing id="kgdz8"></listing><dd id="kgdz8"><strong id="kgdz8"><progress id="kgdz8"><small id="kgdz8"></small></progress></strong></dd><dfn id="kgdz8"><em id="kgdz8"><sub id="kgdz8"></sub></em></dfn><abbr id="kgdz8"></abbr><rp id="kgdz8"></rp><b id="kgdz8"></b><samp id="kgdz8"><pre id="kgdz8"></pre></samp><menuitem id="kgdz8"></menuitem><tt id="kgdz8"><strike id="kgdz8"></strike></tt><option id="kgdz8"></option><b id="kgdz8"></b><small id="kgdz8"></small><ruby id="kgdz8"></ruby><track id="kgdz8"></track><listing id="kgdz8"><pre id="kgdz8"></pre></listing><kbd id="kgdz8"><strong id="kgdz8"></strong></kbd><nobr id="kgdz8"><address id="kgdz8"><table id="kgdz8"><address id="kgdz8"></address></table></address></nobr><sup id="kgdz8"><button id="kgdz8"><input id="kgdz8"><dfn id="kgdz8"></dfn></input></button></sup><dl id="kgdz8"><dfn id="kgdz8"><td id="kgdz8"><form id="kgdz8"></form></td></dfn></dl><tt id="kgdz8"></tt><dl id="kgdz8"></dl><ruby id="kgdz8"><strong id="kgdz8"></strong></ruby><code id="kgdz8"><ins id="kgdz8"></ins></code><li id="kgdz8"><dl id="kgdz8"><th id="kgdz8"></th></dl></li><tt id="kgdz8"></tt><p id="kgdz8"><kbd id="kgdz8"><strong id="kgdz8"><mark id="kgdz8"></mark></strong></kbd></p><dfn id="kgdz8"></dfn><dl id="kgdz8"></dl><meter id="kgdz8"><th id="kgdz8"><tbody id="kgdz8"><th id="kgdz8"></th></tbody></th></meter><thead id="kgdz8"></thead><font id="kgdz8"></font><progress id="kgdz8"><track id="kgdz8"></track></progress><strong id="kgdz8"></strong><optgroup id="kgdz8"></optgroup><th id="kgdz8"><dl id="kgdz8"></dl></th><menuitem id="kgdz8"><strong id="kgdz8"><sup id="kgdz8"><table id="kgdz8"></table></sup></strong></menuitem><ol id="kgdz8"><small id="kgdz8"></small></ol><samp id="kgdz8"><pre id="kgdz8"><mark id="kgdz8"><listing id="kgdz8"></listing></mark></pre></samp><th id="kgdz8"><track id="kgdz8"></track></th><center id="kgdz8"><optgroup id="kgdz8"></optgroup></center><th id="kgdz8"></th><del id="kgdz8"><th id="kgdz8"><dl id="kgdz8"><button id="kgdz8"></button></dl></th></del><tfoot id="kgdz8"><track id="kgdz8"><span id="kgdz8"></span></track></tfoot><strike id="kgdz8"><ins id="kgdz8"></ins></strike><mark id="kgdz8"></mark><p id="kgdz8"></p><font id="kgdz8"></font><tr id="kgdz8"><nobr id="kgdz8"></nobr></tr><label id="kgdz8"><legend id="kgdz8"><ruby id="kgdz8"><big id="kgdz8"></big></ruby></legend></label><strong id="kgdz8"><div id="kgdz8"></div></strong><dl id="kgdz8"><sup id="kgdz8"><dl id="kgdz8"></dl></sup></dl><meter id="kgdz8"></meter><dl id="kgdz8"><ruby id="kgdz8"></ruby></dl><em id="kgdz8"></em><b id="kgdz8"><pre id="kgdz8"></pre></b><fieldset id="kgdz8"><center id="kgdz8"><acronym id="kgdz8"></acronym></center></fieldset><ins id="kgdz8"></ins><var id="kgdz8"><font id="kgdz8"></font></var><b id="kgdz8"></b><track id="kgdz8"></track><sub id="kgdz8"><form id="kgdz8"></form></sub><progress id="kgdz8"><dfn id="kgdz8"></dfn></progress><tt id="kgdz8"></tt><em id="kgdz8"></em><tt id="kgdz8"></tt><button id="kgdz8"><input id="kgdz8"><em id="kgdz8"><i id="kgdz8"></i></em></input></button></div>
      
      </html>