Jump to content
#StayAtHome ×

Search the Community

Showing results for tags 'codeigniter'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 9 results

  1. How to work with frameworks ??? from where whould I start learning this topics ??
  2. Hi, I have a folder called "skeleton" which sits in the root of my website. Inside the folder is a selection of folders and files e.g. -- skeleton -- areas -- uk.html -- pages -- contact.html -- index.html -- images -- panda.jpg -- javascript -- jquery.js Using code ignitors built in zip library I have managed to successfully get zip a folder with all the child files/folders, however it is also including the root "skeleton" folder inside the zip file which i'm trying to exclude. Does anyone know if there is a way to exclude the root directory you are zipping? I have had a read of the documentation at https://ellislab.com/codeigniter/user-guide/libraries/zip.html and cannot find the answer or am simply overlooking it. My code is as follows: $this->zip->read_dir("./skeleton", false); $this->zip->archive($this->skeleton_path."remote_skeleton.zip"); Any help much appreciated. Thanks, MoFish
  3. I'm working with a relationship table: id (AI), user_id, friend_id, status, type. The current behavior is that the Logged In user can send friendship requests to X user but if there is already a friendship request coming from the X user to the Logged In user; the logged in user instead of sending a new request to X user, he/she should accept the one that is already in the database(which is coming from the X-user). Here is an image of what I'm talking about(in the image, the status column displays 'accepted' but try to imagine it as it was 'pending', please) : So I currently have a function for adding friends for the current Logged-In user and it goes like this: public function follow($username){ // Check Login if(!$this->session->userdata('user_id')){ // Redirect to page redirect('users/login'); } // Get item $item = $this->User_model->get_username($username); // Already friends? $friendship = $this->User_model->the_relationship($item->id); if ($friendship->status == 'accepted' || $friendship->status == 'pending') { // Create Message $this->session->set_flashdata('error', 'You are already following this user.'); // Redirect to pages redirect('users/profile/'.$item->username); // BEGINNING OF - HERE IS WHERE THE PROBLEM IS } elseif($friendship->status == 'pending'){ // Get item $item = $this->User_model->get_username($username); // Page Data $data = array( 'user_id' => $item->id, 'friend_id' => $this->session->userdata('user_id'), 'status' => 'accepted', ); $this->User_model->updateFriendship($item->id, $data); /// END OF - HERE IS WHERE THE PROBLEM IS } else { // Get item $item = $this->User_model->get_username($username); // Page Data $data = array( 'user_id' => $this->session->userdata('user_id'), 'friend_id' => $item->id, 'status' => 'pending', 'type' => 'friendship', ); $this->Relationship_model->add($data); // Activity Array $data = array( 'resource_id' => $this->db->insert_id(), 'type' => 'friendship', 'action' => 'sent', 'user_id' => $this->session->userdata('user_id'), 'message' => '(' . $this->session->userdata('username') . ') sent a friend request to ('.$item->username.') ', ); // Insert Activity $this->Activity_model->add($data); // Set Message $this->session->set_flashdata('success', 'Friend request has been sent'); // Redirect redirect('users/profile/'.$item->username); } } and here are the two functions in the model which check the current status of the relationship between the current logged in user and the X user; the second function should update the status of the friendship if there is already one: LEGEND: $this->relationship: ci_relationship table $this->type: friendship type // Relationship for single public function the_relationship($id){ $this->db->select('*'); $this->db->from($this->relationship); $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->where('friend_id', $id); $this->db->where('type', $this->type); $query = $this->db->get(); if($query->num_rows() >= 1){ return $query->row(); } else { return false; } } // Update Friendship Status public function updateFriendship($id, $data){ $this->db->where('user_id', $id); $this->db->where('friend_id', $this->session->userdata('user_id')); //$this->db->where('status', 'pending'); $this->db->where('type', $this->type); $this->db->update($this->relationship, $data); } I hope I could make myself clear. Thanks in advance.
  4. Hi, I created the menu using Codeigniter Framework, it works great at websol.biz, unfortunately it returns <UL><LI> in each parent menu, how do I restrict Home and other buttons in a loop OR how to I program accordingly that it should not loop UL LI, tags under parent menu you can see the code samples of my practice. webpage - > websol.biz (live) <!-- Top Bar--> <div class="top"> <div class="row"> <div class="col-sm-3"> <div class="logo"> <a href="index.html"><img src="<?php echo base_url(); ?>public/images/logo.png" alt="" /> </a> </div> </div> <div class="col-sm-9"> <nav id="desktop-menu"> <ul class="sf-menu" id="navigation"> <?php foreach($content as $row) { $title = $row->menu_name; $id = $row->id; $link = $row->link_id; $id_a = $row->id_c; ?> <li <?php $method_name = $this->router->fetch_method(); if ($method_name==strtolower($title)) { echo "class=current"; } ?> ><a href="<?php echo base_url(); ?><?php echo $link; ?>"><?php echo $title; ?></a> <?php echo "<ul>"; for($i=0;$i<count($sub_menu); $i++) { $row2 = $sub_menu[$i]; $id_c = $row2->id_c; $title_c = $row2->menu_name2; $parent_num = $row2->parent_id; $anchor = $row2->link_id; //print_r($row2); //echo "<br>".$title."--id_c = ".$id_c = $row2->id_c; if(strtolower($title)==strtolower($id_c)) { ?> <li><a href="<?php echo $anchor; ?>"><?php echo $title_c; ?></a></li> <?php } else echo ""; ?> <?php } ?> </li> <?php echo "</ul>"; ?> <?php } ?> </ul> </nav> </div> </div> </div> <!-- End of Top Bar--> Database - > http://prntscr.com/7yd6xh
  5. Hi! I'm newer in codeigniter and I have searched on web an example of code captcha that works. Many examples not working, but an example maybe could work. This example is here http://runnable.com/UXb8GazDrMMiAAEA/how-to-add-a-captcha-in-codeigniter I want to use this example, but I don't know how to configure the files from application/config Could you help me? If you know an example that works you could say me the address on web. Thank you very much!
  6. Hello, I've got a question about ddos attack. As happen before our site has been attack, i think it was a ddos attack which crash our server. Back then our web app and database are on the same server. As now web app and database are separate. site is on windows server and its connected to database from other server also (Linux). If an attack like that happen again, is the database server can be prevent from crashing as it is now separate? Thanks. I have a site running on windows server and its connected to database from other server also (Linux).
  7. Codeigniter POST request empty. I tried to up my website on our production server which is using IIS8, post request is empty, I've tried to break codeigniter and post is working. It is also working on our staging server which is on IIS6. Does anyone has an issue on this on Codeigniter 3.
  8. Having problems viewing pages of my codeigniter based hospital management system. Can only view the homepage, other pages missing, really dont know how to fix it. Uploaded it with the sql on google drive. https://drive.google.com/file/d/0B2NbxciE_vU6S29hZGl5OW1QbzQ/view?usp=sharing Only page uploaded is tthe homepage as see below, rest are missing -- -- Dumping data for table `pages` -- INSERT INTO `pages` (`id`, `title`, `slug`, `parent_id`, `order`, `template`, `body`) VALUES (1, 'Home', '', 0, 1, 'homepage', '');
  9. Hello, I'm just confuse on the way apache and iis react on codeigniter framework accessing folder. on my IIS site when I don't allow folder to be access on web.config it will automatically show codeigniter 404 page as it should be, but on apache its not, its like I have to set 404 on .htaccess by that it will show apache 404 not on framework side. How do I set that accessing not allowed folder on apache will show framework 404.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.