codeigniter

Not allowed to load local resource: file:///

╄→гoц情女王★ 提交于 2019-12-31 04:47:06
问题 I have some images in a folder called "Slides" in my project; I am trying to access those images; but it gives me the following error: Not allowed to load local resource: file:///C:/xampp/htdocs/MyProject/Slides/123_completed.jpg where is "file://" coming from?! (Probably thats the problem!) this is my method to scan the images in the folder called "Slides" the following line of code is in my $this->signage_Path = realpath(APPPATH . '../Slides'); public function get_Signage_Images() { $files

Storing specific Date/Time values for users in different time zones

蹲街弑〆低调 提交于 2019-12-31 04:31:27
问题 I'm working on a PHP(CodeIgniter)/MySQL application that allows users select when their blog post will be published. How I have designed it to work so far is as below: User sets the timezone in his/her profile. User sets the publish date of the blog post. This date/time is assumed to be based on user's timezone. Based on user's timezone, the publish date is converted to UTC (00:00). The converted date is stored as DATETIME in mysql. Server frequently converts the stored DATETIME values to

how to perform sorting,search,pagination in codeigniter

ぐ巨炮叔叔 提交于 2019-12-31 04:26:08
问题 I'm a fresher in codeigniter. I want to search,sort and apply pagination to my table. I tried my best.when search code is working sorting may not work. i can't perform these three actions in a single table. please help me. 回答1: use Bootstrap datatables. It has in built search, Sort and pagination too. Sample of My code In View <div style="clear: both; margin-top: 35px"></div> <div class="container"> <div class="col-sm-12" style="padding: 0px"> <div class="row"> <div class="col-sm-10 col-sm

PHPSpreadsheet generates an error “Wrong number of arguments for INDEX() function: 5 given, between 1 and 4 expected”

醉酒当歌 提交于 2019-12-31 04:08:25
问题 I tried to enter the following code in my excel formula bar directly =INDEX($E$4:$E$132,AGGREGATE(15,6,ROW($1:$30) / ($J$4:$J$132=M4), COUNTIF($M$4:M4, M4))) and works perfectly fine (the left column on the pic below). But if I'm using my web application to generate an excel report file (PHP, using CodeIgniter and Laravel). It displays an error " 'Wrong number of arguments for INDEX() function: 5 given, between 1 and 4 expected' " Here's my sample code snippet: $code = "=INDEX(\$E\$4:\$E\$

site_url changes localhost to [::1]

扶醉桌前 提交于 2019-12-31 04:07:28
问题 I've used CodeIgniter before and it's been quite a long time since I've last used it so I'm basically going back to step 1. I have the controller CaseCon with the following codes public function index() { $this->load->view('CaseView'); } public function sendTicket() { echo "This is sendTicket function"; } and my html page has the following code <form method="POST" action="<?php echo site_url('CaseCon/sendTicket');?>"> <input id="full_name" type="text" class="validate" name="Name" value="Name"

Running shell commands using PHP script

[亡魂溺海] 提交于 2019-12-31 03:53:06
问题 I'm creating an app using CodeIgniter, but I'm unable to run Linux commands using my PHP script. How do I run terminal commands? I've tried shell_exec() and exec() , but both don't work while using CI. 回答1: That depends on your server configuration if the functions are disabled, you need to enable them in your php.ini . Here are some alternatives: popen() or if you need an interactive way try proc_open() system() 来源: https://stackoverflow.com/questions/16240411/running-shell-commands-using

echoing in the view page

你离开我真会死。 提交于 2019-12-31 03:46:07
问题 I'm trying to echo a field of my database in the view, but I'm getting the error: Message: Trying to get property of non-object Filename: views/admin_view_report.php Line Number: 7 When I echo the whole array, it works just fine. I can't find what's wrong. Part of my controller: function index(){ $this->load->model('viewreport'); $data['records']=$this->viewreport->getAllByChk(); $this->load->view('admin_view_report',$data); } Part of my model: function getAllByChk(){ $q = $this->db->get(

Codeigniter 2: The requested URL was not found on this server (404) error. CI isn't routing the right way

*爱你&永不变心* 提交于 2019-12-31 03:43:07
问题 This is one of the most repeated questions, but I did not get it and had to ask. I use CI 2. I removed index.php from URL by following steps: In config.php I set $config['index_page'] = ''; $config['uri_protocol'] = 'REQUEST_URI'; In routes.php I set $route['default_controller'] = "InterviewController"; here is my .htaccess RewriteEngine on RewriteCond $1 !^(index\.php|img|robots\.txt|css|js|libraries/ckeditor|upload) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

can't use session at codeIgniter

ⅰ亾dé卋堺 提交于 2019-12-31 03:25:11
问题 I have a session in my form controller the session is create when the user save the session affect the form page so my problem is : if I loaded the page without clicking on save a undefined index[session index] error appears so I created the session at the home page but the problem is if I loaded the form page without visiting the home page at first the undefined index error appear I tried to call the method session_start() but I got this error A PHP Error was encountered Severity: Notice

CodeIgniter project loads blank webpage

谁说胖子不能爱 提交于 2019-12-31 02:57:29
问题 I have a codeigniter project that I have run successfully on Mac OS X Lion. When attempting to run the same project in ubuntu, requesting localhost/project results in a blank page with no source. I've added AllowOverride All to apache.conf to no avail. My latest strategy has been to put a die() statement in strategic places in the index and included files, trying to find the line on which the code fails. Through this method, I've found in system/core/CodeIgniter.php that a die statement