Search Results

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

Page 32/40 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • directory_map() not working outside of application

    - by iamdadude
    Is there a reason as to why $map = directory_map('./', TRUE); works perfectly and, $map = directory_map('../', TRUE); doesn’t work at all? I tried creating a directory with the basic mkdir(); PHP function (http://php.net/mkdir) and it didn’t work either. Can anyone set me in the right direction as to what I’m doing wrong and how I can fix it? Thanks!

    Read the article

  • Using a single PHP script for an entire site

    - by briggins5
    I had an idea today (that millions of others have probably already had) of putting all the sites script into a single file, instead of having multiple, seperate ones. When submitting a form, there would also be a hidden field called something like 'action' which would represent which function in the file would handle it. I know that things like Code Igniter and CakePHP exist which help seperate/organise the code. Is this a good or bad idea in terms of security, speed and maintenance? Do things like this already exist that i am not aware of?

    Read the article

  • How can i get my delete messages function just appear for the user's own messages left on their friends page?

    - by Hannah_B
    I had been working on this trying the delete message button to work on my own profile page of my site. When I delete a message left by a friend it not only deletes it from the screen but deletes it from the database. The messages in the database have 4 fields: message_id, from, to and message. Here is my profile view that shows how Im deleting messages from my friends: if(!empty($messages)){ foreach($messages as $message): $delete = $message['message_id']; //var_dump($message); ?> <li><?=$message['from']?> says...: "<?=$message['message']?>"(<?=anchor("home/deleteMsg/$delete", 'delete')?>)</li> //this is where the delete button appears beside messages left <?php endforeach?> <?php }else{ ?> <?php echo 'No messages left yet !!!'; }?> Here is my controller showing the deleteMsg function called: function deleteMsg($messageid) { $this->messages->deleteMsg($messageid); redirect('home'); } Here is the messages model showing the deleteMsg model itself: function deleteMsg($message_id) { $this->db->where(array('message_id' => $message_id)); $this->db->delete('messages'); } Here is my friendprofile view where I want to implement the delete message command just so the button appears for messages Ive left and I can delete them. The delete button will not appear beside other friends comments on this page: <li><?=$message['from']?> says...: "<?=$message['message']?>"</li> Now I've tried creating a new delete Message function to no success so far, am I better off doing this than calling the same function? As this didnt work either.

    Read the article

  • Bootstrap Carousel dont work propely

    - by olga1011
    <div class="container-fluid"> <div class="row-fluid"> <div class="span8"> <div id="myCarousel" class="carousel slide"> <!-- Carousel items --> <div class="carousel-inner"> <div class="active item"><img src="01.jpg" alt=""></div> <div class="item"><img src="02.jpg" alt=""></div> <div class="item"><img src="03.jpg" alt=""></div> <div class="item"><img src="02.jpg" alt=""></div> <div class="item"><img src="03.jpg" alt=""></div> </div> <!-- Carousel nav --> <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a> <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a> </div> </div> </div> </div> I am working on site based on this theme http://bootstrapwp.rachelbaker.me/ When i put Bootstrap Carousel its jumping on the last frame and show nothing. I have read many tutorials and couldnt understand what i did wrong. I following the theme instruction. My site http://shopogolick.16mb.com Thank in advance!

    Read the article

  • Getting certain array from a multidimensional array

    - by Leron
    I have multidimensional array which is a query returning the info from a table named 'users'. In another part of my code I need to get the records of only one certain user and I want to take it using the array I mentioned above. It's of type: array(24) { [0]=>array(9) { ["id"]=>string(1) "1" ... } [1]=>array(9) { ["id"]=>string(1) "2" ... } [2]=>array(9) { ["id"]=>string(1) "5" ...} I'll use foreach compairing by ["id"] to find the record I need, but when I get a match I'm not sure how to extract only this array from the parent one. Thanks Leron

    Read the article

  • How to find and update the next record in a linking table

    - by someoneinomaha
    I have a classifieds system I'm working on. People are able to add photos to a classified, but I only display one when displaying the list of classifieds. To do that, I have a linking table between classifieds and photos that has a "is_main" boolean field. When someone deletes one of their classified photos, I want to: 1) See if there is more than that photo tied to the classified. 2) If there is, update the next photo and set that "is_main" field to TRUE. Just trying to find out the most efficient way to do this.

    Read the article

  • Easier way to populate form data and validation data in Code Igniter?

    - by John
    I'm new to code igniter. I'm following the form validation tutorial found at: http://www.codeignitor.com/user_guide/libraries/validation.html I find I am typing too much in the view to get the form to re-populate. For example, here's what one of my INPUT fields look like: <input type="text" name="email" value="<?=$this->validation->email ? $this->validation->email : $array_db_values['email'] ?>" /> Basically, when the form first loads, it should show a value from the database. If the user alters the value and it fails validation, then the form should post the erroneously submitted value. Does code igniter have a "cleaner" way of rendering this kind of output? Otherwise, I'm going to do something like this in my controller: $array_db_values = getdbresults(); if($_POST['submit']) foreach($_POST as $key=>$val) $array_db_values[$key] = $val; That way, if postback data exists, it will always override database values. Then input fields in my view can simply be: <input type="text" name="email" value="<?=$array_db_values['email'] ?>" /> Is there a better/native CI way to handle this scenario?

    Read the article

  • populating on the basis of array elements in php

    - by Avinash
    This is my code. if(in_array("1", $mod)){ $res=array('First Name','Insertion','Last Name','Lead Country');} if(in_array("2", $mod)){ $res=array('Landline No:','Mobile No:','Lead Country');} if(in_array("3", $mod)){ $res=array('City','State','Country','Lead Country');} if(in_array("4", $mod)){ $res=array('Email','Lead Country');} return $res; Upto this it works fine. But if the array contains more than one value say (1,3) I need to return both results of 1 and 3. eg: if the array is like this array([0]=>1 [1]=>3) then $res=array('First Name','Insertion','Last Name','City','State','Country','Lead Country') But if there are 2 lead country only one should be displayed how to do this? Pls help me.

    Read the article

  • How do I extend the code igniter controller class?

    - by ChronoFish
    Hello, In my CI system\libraries directory I have a new class named DD_Controller.php. This file looks like this: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class DD_Controller extends Controller { protected $ddauthentication; function __construct() { parent::Controller(); $this->ddauthentication = "Authenticated"; } } ?> My application controller is defined like this: class Inquiry extends DD_Controller {...} The Inquiry class works fine when I extend Controller, but I get a Fatal error: Class 'DD_Controller' not found in C:\development\localhost\applications\inquiry\controllers\inquiry.php on line 4 When I extend DD_Controller. In the config file I have the prefix defined as such: $config['subclass_prefix'] = 'DD_'; Any idea of what I'm missing? TIA

    Read the article

  • How to handle #(hash) character in SEO friendly url?

    - by arvinsim
    How do you bypass the default behaviour if #(hash) which is to go to a specific part of a page? The problem that I have is that the # character is a part of the SEO friendly url which is a title and the #(hash) is part of the content (i.e. like with C#). I can't retrieve the whole string and I only get the characters before the #. Example: www.domain.com/C#-programming-book in this example I only get 'C' and not the '-programming-book' part. I am not using any javascript at the moment and would like to only use a PHP solution for this. Before anyone suggests that I used url encoding, the criteria for the seo friendly url is that it should be human readable and easily remembered. So converting the hash to '%23' does not pass the criteria. Is there no way around it?

    Read the article

  • CI controller function is ignored

    - by den-javamaniac
    Hi. I'm trying to pass through a CI tutorial (writing a simple forum) and I can't make a controller function called. To be more specific I have this in a controller: function __construct() { parent::Controller(); $this->load->helper('url'); } function index() { $data['title'] = "Wlcome to Gossip"; $data['heading'] = "Welcome to Gossip"; $data['query'] = $this->db->get('topic')->result(); $this->load->view('welcome', $data); } function topic() { echo 'testing...'; } and when I'm trying to access the /index.php/forum/topic/ uri it just prints out my index() function. Can any one point out what may cause the problem?

    Read the article

  • Trying to pass variable from 1 Function to Another to Put in Array within same Model

    - by Jason Shultz
    Ok, that sounds really confusing. What I’m trying to do is this. I’ve got a function that uploads/resizes photos to the server. It stores the paths in the DB. I need to attach the id of the business to the row of photos. Here’s what I have so far: function get_bus_id() { $userid = $this->tank_auth->get_user_id(); $this->db->select('b.id'); $this->db->from ('business AS b'); $this->db->where ('b.userid', $userid); $query = $this->db->get(); if ($query->num_rows() > 0) { return $query->result_array(); } That get’s the id of the business. Then, I have my upload function which is below: /* Uploads images to the site and adds to the database. */ function do_upload() { $config = array( 'allowed_types' => 'jpg|jpeg|gif|png', 'upload_path' => $this->gallery_path, 'max_size' => 2000 ); $this->load->library('upload', $config); $this->upload->do_upload(); $image_data = $this->upload->data(); $config = array( 'source_image' => $image_data['full_path'], 'new_image' => $this->gallery_path . '/thumbs', 'maintain_ratio' => true, 'width' => 150, 'height' => 100 ); $this->load->library('image_lib', $config); $this->image_lib->resize(); $upload = $this->upload->data(); $bus_id = $this->get_bus_id(); $data = array( 'userid' => $this->tank_auth->get_user_id(), 'thumb' => $this->gallery_path . '/thumbs/' . $upload['file_name'], 'fullsize' => $upload['full_path'], 'busid'=> $bus_id['query'], ); echo var_dump($bus_id); $this->db->insert('photos', $data); } The problem I’m getting is the following: A PHP Error was encountered Severity: Notice Message: Undefined index: id Filename: models/gallery_model.php Line Number: 48 I’ve tried all sorts of ways to get the value over, but my limited knowledge keeps getting in the way. Any help would be really appreciated.

    Read the article

  • [ask][php] find dynamic filename exist

    - by r4ccoon
    hi. i am writing a cache module in php. it tries to write a cache with a $string+timestamp as a filename. i dont have problem with writing the cache. the problem is i do a foreach loop to get the cache that i want. this is the logic that i use for getting the cache foreach ($filenames as $filename){ if(strstr($filename,$cachename)){//if found if(check_timestamp($filename,time())) display_cace($filename); break; } } but when it tries to get and read the cache, it slows the server down. imagine that i have 10000 cache file in a folder, and i need to check for every file in that cache folder. so how do you think the best way of doing this. here i explain again, because even me still dont understand my written question.. :D i write cache file with this format filename_timestamp.. e.g cache_function_random_news_191982899010 in a folder ./cache/ when i want to get the cache, i only pass "cache_function_random_news_" and check recursively on that folder. if i find something with that needle on a file name, display it, and break. but checking recursively on a 10000 files in a folder is not a good thing yeah? please give me your opinion ok, that would clarify more. thanks.

    Read the article

  • Should Wordpress be used to create a real estate listing site?

    - by John
    I have a real estate agent client who wants a website to list the properties he's selling. Although there are great 3rd party web apps out there that do this, he adamantly demands that I recreate a simple and custom website for him. I can do this quickly with a php framework like Code Igniter that comes with MVC, data access objects and data bind controllers. The database would be straightforward: t_page: generic content pages t_property: for each property on the market, has fields like address, price, #of bed rooms etc.. However, the client has heard many great things about Wordpress, and strongly advises that I build his real estate site with it. I've only used Wordpress to create blogs and relatively straightforward websites. SO I dont know how effective it is as a real estate property content management system or how effective it is for users to search for real estate properties based on attributes such as "# of bedrooms, square footage, is basement finished etc..." So my question is, is it a good idea to build a real estate agent website with Wordpress? Or should I try harder to convince him to build it with web framework like Code Igniter?

    Read the article

  • Random Quote in html using codeignitor

    - by user1503606
    I am getting random quotes in my html see image below, and i cant for the life of me figure out how to get rid of them i have traced it right back to my model and their are now quotes there, i have also compressed all my code and there is still quotes??? Any one had this bug??? heres my php <ul><?php foreach ($account_media as $value) : ?><li class="span2"></li>?<?php endforeach; ?></ul> i am using codeignitor

    Read the article

  • Save data from array in variable

    - by marcin_poland
    SOLVED! I`m trying save data from array in variable. I have in controller: $data = array('upload_data' => $this->upload->data()); and I know that in this array are data about uploading file. One with this date is "file_name", and I want to save this value in controller at variable. I try with: $image_name= $data['file_name']; But this not working. I use CodeIginter 2.1.3 framework. Good solution is: $data['upload_data']['file_name']; Thanks for help!

    Read the article

  • Visual Website Optimizer and Code Igniter

    - by absentx
    We are trying to integrate visual website optimizer into a site of ours that uses Code Igniter. The problem is when we go into the VWO control panel to look at stats and previews nothing seems to be working. In the previews panel, all of them come up as code igniter error pages that say "The URI you submitted has disallowed characters." I have researched some solutions to this and have tried changing the regex in system/config to allow more characters, all characters etc and I am still having the problem. Any known issues or problems trying to integrate VWO and Code Igniter? This definitely seems to be a url issue but I can't nail it down.

    Read the article

  • Pagination, next page doesn`t display

    - by user1738013
    if I click page 2 that`s error: Not Found The requested URL /rank/GetAll/30 was not found on this server. My link is: http://localhost/rank/GetAll/30 Model: Rank_Model <?php Class Rank_Model extends CI_Model { public function __construct() { parent::__construct(); } public function record_count() { return $this->db->count_all("ranking"); } public function fifa_rank($limit, $start) { $this->db->limit($limit, $start); $query = $this->db->get("ranking"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } return $data; } return false; } } ?> Controller: Rank <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class rank extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper("url"); $this->load->helper(array('form', 'url')); $this->load->model('Rank_Model','',TRUE); $this->load->library("pagination"); } function GetAll() { $config = array(); $config["base_url"] = base_url() . "rank/GetAll"; $config["total_rows"] = $this->Rank_Model->record_count(); $config["per_page"] = 30; $config["uri_segment"] = 3; $this->pagination->initialize($config); $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0; $data["results"] = $this->Rank_Model->fifa_rank($config["per_page"], $page); $data['errors_login'] = array(); $data["links"] = $this->pagination->create_links(); $this->load->view('left_column/open_fifa_rank',$data); } } View Open: open_fifa_rank <?php $this->load->view('mains/header'); $this->load->view('login/loggin'); $this->load->view('mains/menu'); $this->load->view('left_column/left_column_before'); $this->load->view('left_column/menu_left'); $this->load->view('left_column/left_column'); $this->load->view('center/center_column_before'); $this->load->view('left_column/fifa_rank'); $this->load->view('center/center_column'); $this->load->view('right_column/right_column_before'); $this->load->view('login/zaloguj'); $this->load->view('right_column/right_column'); $this->load->view('mains/footer'); ?> and View: fifa_rank <table> <thead> <tr> <td>Pozycja</td> <td>Kraj</td> <td>Punkty</td> <td>Zmiana</td> </tr> </thead> <?php foreach($results as $data) {?&gt; <tbody> <tr> <td><?php print $data->pozycja;?></td> <td><?php print $data->kraj;?></td> <td><?php print $data->punkty;?></td> <td><?php print $data->zmiana;?></td> </tr> <?php } ?> </tbody> </table> <p><?php echo $links; ?></p> Maybe you know where is my problem? Now I know where is my problem. In first page I have link: http://localhost/index.php/rank/GetAll But on the next: http://localhost/rank/GetAll/30 In secend link, I don`t have index.php. How can I fix it?

    Read the article

  • Not getting an array as result (calling a webservice by AJAX-JSON)

    - by Pasargad
    I'm trying to get the result of my web service as an array and then loop over the result to fetch all of the data; what I have done so far: In my web service when I return the result I use return json_encode($newFiles); and the result is as following: "[{\"path\":\"c:\\\\my_images\\\\123.jpg\",\"ID\":\"123\",\"FName\":\"John\",\"LName\":\"Brown\",\"dept\":\"Hr\"}]" tehn in my Web application I'm calling the rest web service by the following code in the RestService class: public function getNewImages($time) { $url = $this->rest_url['MyService'] . "?action=getAllNewPhotos&accessKey=" . $this->rest_key['MyService'] . "&lastcheck=" . $time; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); if ($data) { return json_decode($data); } else { return null; } } and then in my controller I have the following code: public function getNewImgs($time="2011-11-03 14:35:08") { $newImgs = $this->restservice->getNewImages($time); echo json_encode$newImgs; } and I'm calling this `enter code here`controller method by AJAX: $("#searchNewImgManually").click(function(e) { e.preventDefault(); $.ajax({ type: "POST", async: true, datatype: "json", url: "<?PHP echo base_url("myProjectController/getNewImgs"); ?>", success: function(imgsResults) { alert(imgsResults[0]); } }); }); but instead of giving me the first object it is just giving me quotation mark (the first charachter of the result) " Why is that? I'm passing in JSON format and in AJAX I mentioned datatype as "JSON" ! Please let me know if you need more clarification! Thanks :)

    Read the article

  • HTML/CSS Design for Report

    - by Kevin Brown
    I'm looking for some resources that demonstrate good graphic design for generated (PHP/HTML/CSS) reports. The website I'm designing is essentially a long test. Everything is finished except the report generation, and this part needs to look good! I'd appreciate any advice/resources you can point me to! I know this isn't directly programming related, but my purposes do encompass coding and output.

    Read the article

  • This query show me with this active record

    - by New Kid
    I am having trouble getting two tables and passing them to controller: IN A MODEL: function get_all_entries() { $query = $this->db->get('entry'); return $query->result(); $this->db->select('entry_id , count(comment_id) as total_comment'); $this->db->group_by('entry_id'); $comment = $this->db->get('comment'); return $comment->result(); } IN A CONTROLLER: $data['query'] = $this->blog_model->get_all_entries(); $this->load->view('blog/index',$data); How do I return $query and $comment variables to controller? I think I am doing it wrong.

    Read the article

  • Empty database output in CI

    - by den-javamaniac
    Hi. I'm building a simple app and trying to test DB result output. But unfortunately all I'm getting is an array of size 0. Here's the controller code excerpt: $data['query'] = $this->db->query('SELECT role_id, role_privilege FROM role'); $this->load->view('welcome_message', $data); And a view code excerpt: <?php echo count($query->result_array())."<br/>"; foreach ($query->result() as $row){ echo $row->role_id . '<br/>'; echo $row->role_privilege . '<br/>'; } echo 'Total result '.$query->num_rows(); ?> And what I get is next: 0 Total result Running query from a command line gives a 2 rowed output. Can someone point out what i'm missing?

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >