codeigniter

User activation registration with CodeIgniter

两盒软妹~` 提交于 2019-12-24 10:46:06
问题 I'm trying to build a registration system with CodeIgniter. I have a controller called User with the following code: class User extends CI_Controller{ public function __construct() { parent::__construct(); $this->load->model('user_model'); } public function index() { if(($this->session->userdata('user_name')!="")) { $this->welcome(); } else{ $data['title']= 'Home'; $this->load->view('header_view',$data); $this->load->view("registration_view.php", $data); $this->load->view('footer_view',$data)

Codeigniter Shared Resources - Opinions Wanted

天涯浪子 提交于 2019-12-24 10:37:43
问题 I run multiple websites all running off of a single installation of CodeIgniter on my server (separate application directories and a single system directory). This has been working fabulously and I don't see any reason to change it at this point. I find myself writing library classes to extend/override CI all of the time and many times if I find a bug or improve effeciency I have to go back to several websites to make the same adjustments at risk of a typo that breaks one of the websites.

jquery uploadify and codeigniter session id problem

耗尽温柔 提交于 2019-12-24 10:33:06
问题 I know this is famous question but i am not able to make it work refering to those links :- The problem is the same. No session id is being passed which causes a lot of problems. This is my config.php :- $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 2700; $config['sess_encrypt_cookie'] = FALSE; $config['sess_use_database'] = FALSE; $config['sess_table_name'] = 'ci_sessions'; $config['sess_match_ip'] = FALSE; $config['sess_match_useragent'] = FALSE; $config['sess

How to use a Point or Geometry type in Datamapper (codeigniter)

纵然是瞬间 提交于 2019-12-24 10:27:34
问题 I'm using codeigniter and datamapper to build an API service (on mysql), and part of it involves geolocation - however I can't seem to find a workaround to use the point datatype. If I try to insert GeomFromText, the system treats it as a string. Can anyone help? Cheers, Mark. 回答1: Try CREATE TABLE Points ( ID INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, location POINT NOT NULL, SPATIAL INDEX(location) ) ENGINE= MYISAM In CodeIgniter: $this->db->set("location",'geomfromtext("POINT(30.2 40.3)"

Track User Bandwidth With PHP Application

旧街凉风 提交于 2019-12-24 10:16:02
问题 I'm working on campus project using PHP and CodeIgniter. It's only a project for my assignment. Then it comes that i have to limit bandwidth used by user (of app, not linux user). And i have no idea to implement this. I wonder if someone know the logic or ever work on the similar tasks. What basically i need is, how to track that user (system user, not linux user) bandwidth? Should i count every requests and responses for that user? How to count for imagse and static files download for

code igniter :: send url as param?

﹥>﹥吖頭↗ 提交于 2019-12-24 10:01:39
问题 I am creating an ajax function to edit some settings. these must be handled via the url (i.e) the url would be http://example.com/setting1/setting2/setting3 This works fine but. One of the settings is a url. How could I pass this in this way? 回答1: this might work $url = 'http://stackoverflow.com/questions/4245416/code-igniter-send-url-as-param'; $encoded = base64_encode($url); //aHR0cDovL3N0YWNrb3ZlcmZsb3cuY29tL3F1ZXN0aW9ucy80MjQ1NDE2L2NvZGUtaWduaXRlci1zZW5kLXVybC1hcy1wYXJhbQ== // Make your

CURL returns response code 200 and 0 for a same page at different time

二次信任 提交于 2019-12-24 09:59:57
问题 I am facing one unusual behavior of curl. For a given page, I some times get HTTP response code as 200 and sometimes I get 0 as HTTP response code. I am not able to understand whether this page is valid or not. If you try the given code, please try it for at least 5-10 times so that you can see the difference. function print_info() { $url = 'bart.no'; $arr = array( 'bart.no', 'bolandirekt.nu', 'ekompassen.com', 'ekompassen.nu', ); foreach ($arr as $url) { echo "<br/>URL: " . $url; $temp = str

How to redirect from one page to another page in codeigniter

穿精又带淫゛_ 提交于 2019-12-24 09:58:52
问题 I'm not getting how to do this codeignitor concept. How to redirect one page to another page if I click the link? Main1.php <?php class Main1 extends CI_Controller { public function index() { //Load the URL helper $this->load->helper('url'); //Redirect the user to some site redirect('http://localhost/CodeIgniter/index.php/Main'); $this->load->view('test1'); } } ?> test1.php <!DOCTYPE html> <html> <head> <title>view page</title> </head> <body style="padding-top:50px; padding-left:300px"> <h1

CodeIgniter multidimensional array store in mysql database single column

醉酒当歌 提交于 2019-12-24 09:48:56
问题 I am trying to store this data in database but i am getting error. how to fix this? I want simply store multidimensional array in a single column. $data = array( '2017' => array( '6' => array( '10' => array( 'count' => 76 ), ), ), ); $getdata = $this->view_count->setView($data); Model public function setView($data) { $setData = $this->db->where('short', 'honwl')->update('ci_links', $data['view_count']); return $setData; } Error which i am getting A PHP Error was encountered Severity: Notice

CodeIgniter: Call to a member function WriteHTML() on a non-object

佐手、 提交于 2019-12-24 09:48:32
问题 I am getting this error when I an downloading a pdf file using MPDF. I am loading the code here below: $html = $this->load->view('customer/case_report',$this->data, true); $pdfFilePath = "output_pdf_name.pdf"; $this->load->library('M_pdf'); $this->M_pdf->pdf->WriteHTML($html); $this->M_pdf->pdf->Output('CaseReport_CaseNo_'.$caseNo.'.pdf', 'D'); UPDATE Attaching screenshot here: Any help will be greatly appreciated. Thank you 回答1: Alright I have Simulated the case and what Worked is as follows