草庐IT

codeigniter-4

全部标签

codeigniter - 如何在 codeigniter 中发送包含 View 内容的电子邮件

我想从我的应用程序向用户发送一封电子邮件,其中包含从View加载的电子邮件内容。这是我到目前为止尝试过的代码:$toemail="user@email.id";$subject="MailSubjectishere";$mesg=$this->load->view('template/email');$this->load->library('email');$config['charset']='utf-8';$config['wordwrap']=TRUE;$config['mailtype']='html';$this->email->initialize($config);$t

php - 在 codeigniter 中启用 cors(@chriskacerguis 的 restserver)

当我的客户端应用程序和api在本地主机中时,agularJsController中的http.get请求工作正常。当api被移动到服务器时,出现了问题。客户端使用angularJs$http.get('http://example.com/api/spots/2/0').success(function(data){console.log(data);});日志给出:跨源请求被阻止:同源策略不允许在http://example.com/api/spots/2/0读取远程资源.这可以通过将资源移动到同一域或启用CORS来解决。我已将这两行添加到我的Controller构造中header(

php - CodeIgniter 的 CSV 导入库

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭6年前。Improvethisquestion需要将csv或xls导入到使用CodeIgniter创建的应用程序中。有这方面的图书馆吗?任何建议表示赞赏。

php - Codeigniter 没有输入文件指定的错误

我已经在子目录www.siteb.com/rexona中安装了CI我在www.siteb.com/rexona中的.htaccess:RewriteEngineOnRewriteBase/rexona#Removesaccesstothesystemfolderbyusers.#AdditionallythiswillallowyoutocreateaSystem.phpcontroller,#previouslythiswouldnothavebeenpossible.#‘system’canbereplacedifyouhaverenamedyoursystemfolder.Rew

php - 在添加进一步的限制语句 CodeIgniter 之前计算行数?

我遇到了一个问题...我有一堆这样的语句......$this->db->where('Pool',"1");$this->db->where('Bedrooms>=',"3");然后是一个极限语句$this->db->limit($limit,$offset);最后是我的get语句$query=$this->db->get('table-name');我的问题是我需要在限制语句之前计算结果,以获得不受限制的总行数。所以我尝试了这个。$this->db->where('Pool',"1");$this->db->where('Bedrooms>=',"3");$num_rows=$th

php - 无法在 Codeigniter 中定位指定类 : Session. php

浏览器:无法定位指定类:Session.php这是我的Controller:load->model('Chat_model');}publicfunctionindex(){$this->view_data['chat_id']=1;$this->view_data['student_id']=$this->session->userdata('student_id');$this->view_data['page_content']='chat';$this->load->view('chat');}publicfunctionajax_addChatMessage(){$chat_

php - 为什么 CodeIgniter 应用程序文件在 public_html 文件夹中?

让所有文件都公开不是一件坏事吗?当然/system/application/config/database.php之类的东西不应该公开可见! 最佳答案 CodeIgniter的开发者EllisLabs以这种方式建立了框架,以便于使用。这意味着希望试用该框架的人不必在他们的服务器上摆弄任何权限设置。当然,在生产服务器上,您是完全正确的,将您的PHP文件放在公共(public)HTML文件夹中并不是一个好主意。组织文件夹的更好方法是:根代码点火器应用程序文件夹配置控制者模特...系统文件夹public_htmlCSSjs图像索引.php

php - 重定向后 Codeigniter session 数据丢失

我正在使用codeigniter2.1.0。我正在尝试使用codeigniter中的session库执行注册/登录功能。使用session库注册/登录在本地主机上工作正常,但是当我将其投入使用并尝试时,session不起作用。我的Controller登录就是这样工作的。我检查凭据,一旦确定,我就设置我的session数据并重定向到另一个页面。$user_data=array('username'=>$result->user_name,'email'=>$result->user_email,'userid'=>$result->user_id,'role'=>$result->use

php - 我可以将数组添加到 codeigniter 中的 update_batch 的 where 子句吗

我正在使用codeigniterupdate_batch函数。我想将数组作为第三个参数(where子句)传递给update_batch。$data=array(array('title'=>'Mytitle','name'=>'MyName2','date'=>'Mydate2'),array('title'=>'Anothertitle','name'=>'AnotherName2','date'=>'Anotherdate2'));取而代之的是:$this->db->update_batch('mytable',$data,'title');我想这样做:$this->db->upd

php - 在生产服务器 codeigniter 3.1.2(PHP) session 销毁自动从 facebook 图形 API 重定向?

codeignitersession在从graphAPifacebook重定向时销毁,有时它的工作,有时它销毁session并将用户带到登录页面这里是Config.phpsession代码$config['see_driver']='database';$config['see_cookie_name']='ci_session';$config['see_expiration']=0;$config['see_save_path']='ci_sessions';$config['see_match_ip']=FALSE;$config['see_time_to_update']=10