Search Results

Search found 981 results on 40 pages for 'codeigniter 2'.

Page 21/40 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Codeigniter achor producing dodgy link in email inbox.. what could the problem be?

    - by Psychonetics
    My application is emailing out fine but the email I receive displays incorrectly. Rather than have text and a simple "click here to activate" link it doesn't. it shows this instead: Hi user1, please click the following link to activate your account <a href="http://mysite.com/activation/fzyZuyxVAzZS2koVg5UFjfVjlcLNcrzp">ssss</a> Here is the code from my model that sends email to user when they request activation email. $this->load->library('email'); $this->email->from('[email protected]', 'my site'); $this->email->to($result[0]->email); $this->email->subject('my site - Activate your account'); $this->email->message('Hi ' . $result[0]->first_name . ', please click the following link to activate your account ' . anchor('http://mysite.com/activation/' . $new_activation_code, 'click here to activate')); $this->email->send(); Also the mail always ends up in my spam folder.

    Read the article

  • Setting up httpd.conf / mod_rewrite to redirect to codeigniter?

    - by Walker
    I'm sorry to ask this here, as I'm sure the solution is fairly easy but for the life of my I can't setup httpd.conf on my apache server to automatically load the code_igniter files. Instead I'm having to go into the folder itself localhost/trunk/etc/etc until I get index.php - which messes with some of the relative paths (our backend coder is gone for the week so I can't ask him, but he has already setup the rewrite rules on our development server).

    Read the article

  • Codeigniter: A nice straight forward tutorial on how to build a reset password/forgotten password?

    - by Psychonetics
    I've built a full sign up system with user account activation, login, validation, captcha etc. To complete this I now need to implement a forgot password/reset password feature.. I have created one function that generates a random password 8 characters, another method that takes that random password word and applies sha1 and hashing. Also one that takes that hashed password and stores it in a table in the database. I will keep these methods to one side as they might come in handy later on but for now I would like to know if anyone can point me to a nice tutorial for creating a password reset feature for my website. Thanks in advance

    Read the article

  • Is it bad to use a model directly from a view in codeigniter?

    - by jason
    I know normally the data is passed thru to the view with the controller. however, currently in my view I load my model ($this-load-model('Db_model');) so i can use it in a loop to retrieve a users profile picture path from a array of IDs that is passed from controller. Will loading the db model in the view to accomplish this make my site more vulnerable or bad form? To me it seems to be outside of MVC concept but its working atm. thanks

    Read the article

  • Passing an array of data to a private function in CodeIgniter/PHP? [facepalm]

    - by Jack Webb-Heller
    So I thought this should be easy, but, I'm n00bing out here and failing epicly (as they say on teh interwebz). So here's my code: function xy() { $array['var1'] = x; $array['var2'] = y; echo $this->_z; } function _z($array) { $xy = $x.$y; return $xy; } So, why doesn't that seemingly simple code work? I know with views you can pass arrays and the variables are accessible in the views with just their array title, but, why doesn't it work in this case? Jack

    Read the article

  • Codeigniter/mySQL question. Checking if several inserts are possible before actual insertion.

    - by Ethan
    Hey SO, So I'm trying to perform a couple inserts at once that are kind of co-dependent on each other. Let's say I'm doing a dog rating website. Anyone can add a dog to my database, but in doing so they also need to add a preliminary rating of the dog. Other people can then rate the dog afterwards. The dogs to ratings is a many to one relationship: a dog has many ratings. This means for my preliminary add, since I have the person both rate and add the dog, I need to take the rating, and set a foreign key to the dog's primary key. As far as I know, this means I have to actually add the dog, then check what that new addition's primary key is, and then put that in my rating before insertion. Now suppose something were to go wrong with the rating's insert, be it a string that's too long, or something that I've overlooked somehow. If the rating's failed, the dog has already been inserted, but the rating has not. In this case, I'd like the dog to not have been added in the first place. Does this mean I have to write code that says "if the rating fails, do a remove for the dog," or is there a way to predict what the key will be for the dog should everything go as planned. Is there a way to say "hold that spot," and then if everything works, add it? Any help would be greatly appreciated. Thanks!!

    Read the article

  • Setting up httpd.conf / mod_rewrite to auto-load codeigniter?

    - by Walker
    I'm sorry to ask this here, as I'm sure the solution is fairly easy but for the life of my I can't setup httpd.conf on my apache server to automatically load the code_igniter files. Instead I'm having to go into the folder itself localhost/trunk/etc/etc until I get index.php - which messes with some of the relative paths (our backend coder is gone for the week so I can't ask him, but he has already setup the rewrite rules on our development server).

    Read the article

  • Codeigniter Form Validation - how to unset form values after success?

    - by BrynJ
    I realise this request goes against the example provided in the CI documentation (which advises a separate 'success' page view), but I would like to reutilise a given form view after a form has been successfully submitted - displaying a success message then displaying a blank form. I've tried a few ways unsuccessfully to clear the validation set values (unsetting $_POST, setting rules / fields to an empty array and rerunning validatio). I could redirect to the same page, but then I'd have to set a session variable to display a success message - which is a messy approach. Any ideas how to achieve the above?

    Read the article

  • Codeigniter pre_system hook for DB driven dynamic controller selection - best approach?

    - by Andy
    Although I can tentatively see a solution to this, I was wondering if there may be a glaringly obvious simpler approach. My aim is to use the first segment of a given URI to query the DB as to which controller should be run. I assume I would have to reform the URI with the resultant controller name in segment 1, then allow the system to continue processing as normal (hence a pre_system hook). Although not essential I would also like to hold a couple of other variables from the same DB request to be used later in the call stack, and assume this would have to be done using global variables? Any better suggestions would be gladly received. Thanks.

    Read the article

  • Where do you put non-controller classes in codeigniter?

    - by sprugman
    I've got a class Widgets. Widgets are made up of Doohickies. I'm never going to need to access Doohickies directly via url -- they're essentially a private class, only used by Widgets. Where do you put your code to define the Doohicky class? In /app/controllers/doohicky.php? in app/controllers/widget.php? somewhere else? Obviously, the former seems cleaner, but it's not obvious to me how to make the Doohicky class available to Widget.

    Read the article

  • How do I call this function in CodeIgniter controller?

    - by Jason Shultz
    I've got this code, but I'm not sure I make it work: /** * Function: youtube data grabber * * @description : * @param $ : video code, url type (embed/url) * @return : data array * @author : Mamun. * @last -modified-by: Mamun. */ if (! function_exists('youtube_data_grabber')) { function youtube_data_grabber($video_code, $link_type = "embed") { if ($video_code != '') { if ($link_type == "embed") { $splited_data = explode("=",$video_code); $video_unique_code = substr(strrchr($splited_data[4],"/"),1,-strlen(strrchr($splited_data[4],"&"))); } else if ($link_type == "url") { $splited_data = explode("=",$video_code); $video_unique_code = substr($splited_data[1],0,-strlen(strrchr($splited_data[1],"&"))); } else { return; } // set feed URL $feedURL = 'http://gdata.youtube.com/feeds/api/videos/'.$video_unique_code; // read feed into SimpleXML object $sxml = simplexml_load_file($feedURL); return $sxml; } } } // End Youtube Function I'm not sure how to activate it is what I'm trying to say. I placed it in the controller and it's within a function for one of my pages. I don't have any syntax errors. I just don't know how to wake it up and make it work. I thought I could just put youtube_data_grabber('http://www.youtube.com/watch?v=LAcrFym10ZI', 'url'); but that didn't work. I got the code from here: http://bit.ly/b7YnDt and I have the zend functionality working. I tested it earlier and had no errors. I'm just having trouble with this youtube part. Any ideas?

    Read the article

  • Where do I put constants file for Codeigniter (PHP)?

    - by wag2639
    I have a list of constants (I'm using them as an enum), some are define statements, and some are just global variables. Where am I suppose to put them in the MVC framework so I can use them for both my model and my controller that needs to reference it? I'd rather not stick it into config/constants.php since they shouldn't be called except for by this model and the controllers that use it. Edit 1: Clarification To be more specific, I have my message_model model and it has a bunch of constants that I need that are stored in message_model_constants.php. Where should I put message_model_constants.php and is there a way to have it automatically included by the controller that loads message_model when message_model is not (and I don't want it to be) auto-loaded. Edit 2: I really don't want to have the constants auto-loaded except for when I use the model

    Read the article

  • How to get an array of all controllers in a Codeigniter project ?

    - by ashmckenzie
    I'd like to obtain a list of all controllers in a Codeiginiter project so I can easily loop through each of them and add defined routes. I can't seem to find a method that will give me what I'm after ? Here is the code snippet from the routes.php file where I would like to access the array: - // I'd like $controllers to be dynamically populated by a method // $controllers = array('pages', 'users'); // Loop through each controller and add controller/action routes // foreach ($controllers as $controller) { $route[$controller] = $controller . '/index'; $route[$controller . '/(.+)'] = $controller . '/$1'; } // Any URL that doesn't have a / in it should be tried as an action against // the pages controller // $route['([^\/]+)$'] = 'pages/$1';

    Read the article

  • Codeigniter: how to track activity w/o using multiple db rows?

    - by Kevin Brown
    I need to track the completion of tasks for users. I started by having a row called "first_login", "profile_complete", "other_thing_complete", etc... I'd like to combine these all into one row "activity_state". I just don't know how to properly store data in this field, and how to retrieve it. What kind of field should it be, and how should I read/write to it?

    Read the article

  • Codeigniter: How to handle direct link to controller/function/param?

    - by rebjr
    I have a simple controller function which deletes a DB entry (it uses a model function to do so). I have a link to this in one of my views (e.g. http://www.example.com/item/delete/3) and I’m using jQuery to display a confirm dialog to make sure the user really wants to delete it. All fine. However if you just enter that URL in your browser the item is deleted without warning. Is there a way to handle this either in the way I code the controller function or in the model?

    Read the article

  • How to add Exception to route with :any in CodeIgniter?

    - by aslamdoctor
    In my project, have setup an admin panel under a folder inside controllers folder like this controllers/admin_panel/dashboard.php And when we open it like this, it loads dashboard controller default http://www.mysite.com/admin_panel Now I have added a page controller on root level to load the page content from database. So here I have some a setup of kind of CMS. To load the page controller, I have added a condition in routes as below $route[':any'] = "page"; But what it is doing now is, when I try to open admin_panel, it loads the page controller. So I want to add a kind of exception condition here like route any except admin_panel Any suggestions how can I achieve this ? Thanks in advance.

    Read the article

  • How to add sub category on my codeigniter php application ?

    - by sagarmatha
    Hello friends I have a view echo "<label for='parent'>Category</label><br/> "; echo form_dropdown('category_id', $categories). "<p>"; controller function create(){ if($this->input->post('name')){ $this->MProducts->addProduct(); $this->session->set_flashdata('message', 'Products Created'); redirect('admin/products/index', 'refresh'); }else{ $data['title'] = "Create Product"; $data['main'] = 'admin_product_create'; $data['categories']= $this->MCats->getTopCategories(); $this->load->vars($data); $this->load->view('dashboard'); } } and the model is function getTopcategories(){ $data = array(); $data[0] = 'root'; $this->db->where('parentid',0); $Q = $this->db->get('categories'); if($Q->num_rows() > 0){ foreach($Q->result_array() as $row){ $data[$row['id']] = $row['name']; } } $Q->free_result(); return $data; } Basically, what i want is we get sub categories when we click categories and 'selected' subcategory id goes to database when we create products, So that we can list products by sub categories. Please help me how do we do that ?

    Read the article

  • Codeigniter: how do I select count when `$query->num_rows()` doesn't work for me?

    - by mOrloff
    I have a query which is returning a sum, so naturally it returns one row. I need to count the number of records in the DB which made that sum. Here's a sample of the type of query I am talking about (MySQL): SELECT i.id, i.vendor_quote_id, i.product_id_requested, SUM(i.quantity_on_hand) AS qty, COUNT(i.quantity_on_hand) AS count FROM vendor_quote_item AS i JOIN vendor_quote_container AS c ON i.vendor_quote_id = c.id LEFT JOIN company_types ON company_types.company_id = c.company_id WHERE company_types.company_type = 'f' AND i.product_id_requested = 12345678 I have found and am now using the select_min(), select_max(), and select_sum() functions, but my COUNT() is still hard-coded in. The main problem is that I am having to specify the table name in a tightly coupled manner with something like $this->$db->select( 'COUNT(myDbPrefix_vendor_quote_item.quantity_on_hand) AS count' ) which kills portability and makes switching environments a PIA. How can/should I get my the count values I am after with CI in an uncoupled way??

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >