Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 14,372
» Latest member: michlalker
» Forum threads: 69,913
» Forum posts: 433,619

Full Statistics

Latest Threads
softDelete and database i...
Forum: CodeIgniter 4 Support
5 hours ago
» Replies: 17   » Views: 557
CodeIgniter 4 Logo
Forum: News & Discussion
8 hours ago
» Replies: 34   » Views: 9,669
Forum registration on hol...
Forum: News & Discussion
8 hours ago
» Replies: 2   » Views: 1,356
CodeModules Language Prop...
Forum: CodeIgniter 4 Discussion
10 hours ago
» Replies: 0   » Views: 71
Codeigniter application: ...
Forum: General Help
Today, 07:53 AM
» Replies: 0   » Views: 107
Undefined variable: admin...
Forum: General Help
Yesterday, 05:06 PM
» Replies: 9   » Views: 1,233
Do you have a hobby?
Forum: Lounge
Yesterday, 05:23 AM
» Replies: 28   » Views: 13,884
Captcha doest work on Lin...
Forum: General Help
Yesterday, 04:09 AM
» Replies: 3   » Views: 448
Jquery UI modal show not ...
Forum: General Help
Yesterday, 01:07 AM
» Replies: 8   » Views: 1,068
How do I replace front-en...
Forum: CodeIgniter 3.x
08-23-2019, 02:42 PM
» Replies: 9   » Views: 489

 
Question Hellp Disallowed Key Characters.
Posted by: snup55 - 08-04-2019, 11:25 AM - Forum: General Help - No Replies

http://sitename/index.php?video/category/1/Турецкие%20сериалы

Disallowed Key Characters.


help me replace this %20 character with -
in CI's experience a little
if the category name is in English then everything works well and with Cyrillic appears this %20

sorry for my English translated through Yandex


  Edit value on db with ' or "
Posted by: pippuccio76 - 08-04-2019, 02:48 AM - Forum: General Help - Replies (5)

hi , sorry for english , if i want t a value inserted by textarea i have problem with '  .

This is the code :


Code:
 <input class='form-control' type='text' value='<?=$val?>' id='id_class_descrizione_problema' name='descrizione_problema' maxlength='65535' >

$val is a value from db .
How can i prevent error textwith ' or " or \ ?


  Please help, Iarray sort not working
Posted by: soapz - 08-03-2019, 12:26 PM - Forum: General Help - Replies (1)

Hello. Please somebody help..I want to arrange the foreach loop according to the highest number of average exam score. 
I used rsort or sort array but it returns zero.
see my code:

<?php 
$this->db->where('class_id' , $class_id);
$this->db->where('year' , $running_year);
$this->db->from('subject');
$number_of_subjects = $this->db->count_all_results();
$average_score= ($total_marks / $number_of_subjects);
rsort($average_score);
echo(round($average_score,2));
?>
after i get the highest average score i want to rank it as 1st,2nd, 3rd....
Kindly help


  Codeigniter Check For Duplicate on Edit Function
Posted by: incognitorecon - 08-02-2019, 09:13 PM - Forum: General Help - Replies (2)

Check For Duplicate on Edit Function

Currently my DB table

    USERDB
    userId userName userPassword userEmail userAddress userPhone


What I want

> Allow to check on "userName" duplication" and if "userName" return
> true , then it allow to edit other textfield.

Problem Met:

> When i did not change anything on my "userName" field , and i edited
> userEmail, it will always return FALSE due to my "userName" is
> duplicate with current DB data.


    $checkvalidation = $this->userdb->UsernameDuplicatechecking($userName);
    if($checkvalidation == TRUE){
    $this->userdb->updateUser($userName,$userEmail,$userAddress,$userPhone,$id);
    }else{
      $this->session->set_flashdata('errormessage', 'Duplicate');
      redirect("User/EditUserAccount/$id");
      }

Update Model Code

    public function updateUser($userName,$userEmail,$userAddress,$userPhone,$id);
    {
    $UserArray = array(
    'userName' => $userName,
    'userEmail' => $userEmail,
    'userAddress' => $userAddress,
    'userPhone' => $userPhone,
      );
   
   
        $this->db->set($UserArray);
    $this->db->where('userId',$id);
    $this->db->update('USERDB');
    }


  Validation 'alpha' problem
Posted by: bomi - 08-02-2019, 10:46 AM - Forum: General Help - Replies (2)

Hi. I am using form_validation at one input. I set the rule alpha. But also this blocks Turkish characters at this input. What should i do? Form validation thinks the Turkish characters are not alphabetical.

Thanks.  Blush


  Model location error
Posted by: Mekaboo - 08-01-2019, 09:01 PM - Forum: General Help - Replies (2)

Hello!
Ive implemented code within my site and get this error:

Type: RuntimeException

Message: Unable to locate the model you have specified: Blogmodel

Filename: /home4/cultured/public_html/system/core/Loader.php

Line Number: 348

Backtrace:

File: /home4/cultured/public_html/index.php
Line: 315
Function: require_once

Ive added within my autoload and config files the necessary codes as well as added the sql within my DB.  I believe I have to connect my DB with the model but dont know where. How for I change this error?

Here is the model:
<?php


if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of blogmodel
 *
 * @author https://roytuts.com
 */
class BlogModel extends CI_Model {

    private $blog = 'blog';
    private $blog_comment = 'blog_comment';

    function __construct() {
        
    }

    //get blog details
    function get_blog_detail($blog_slug) {
        $query = $this->db->get_where($this->blog, array('blog_slug' => $blog_slug));
        return $query->row();
    }

    //get blog comments for blog slug
    function get_blog_comments($blog_slug) {
        $query = $this->db->query('SELECT bc.comment_id, bc.blog_id, bc.parent_id, bc.comment_text,
                    bc.comment_date FROM ' . $this->blog_comment . ' bc, ' . $this->blog . ' b
                    WHERE bc.blog_id=b.blog_id AND
                        b.blog_slug=' . $this->db->escape($blog_slug) .
                ' ORDER BY bc.comment_date DESC');
        if ($query->num_rows() > 0) {
            $items = array();
            foreach ($query->result() as $row) {
                $items[] = $row;
            }
            //return $items;
            $comments = $this->format_comments($items);
            return $comments;
        }
        return '<ul class="comment"></ul>';
    }

    //add blog comment
    function add_blog_comment($data) {
        $this->db->insert($this->blog_comment, $data);
        $inserted_id = $this->db->insert_id();
        if ($inserted_id > 0) {
            $query = $this->db->query('SELECT bc.comment_id, bc.blog_id, bc.parent_id, bc.comment_text,
                    bc.comment_date
                    FROM ' . $this->blog_comment . ' bc
                    WHERE bc.comment_id=' . $inserted_id);
            return $query->result();
        }
        return NULL;
    }

    //format comments for display on blog and article
    private function format_comments($comments) {
        $html = array();
        $root_id = 0;
        foreach ($comments as $comment)
            $children[$comment->parent_id][] = $comment;

        // loop will be false if the root has no children (i.e., an empty comment!)
        $loop = !empty($children[$root_id]);

        // initializing $parent as the root
        $parent = $root_id;
        $parent_stack = array();

        // HTML wrapper for the menu (open)
        $html[] = '<ul class="comment">';

        while ($loop && ( ( $option = each($children[$parent]) ) || ( $parent > $root_id ) )) {
            if ($option === false) {
                $parent = array_pop($parent_stack);

                // HTML for comment item containing childrens (close)
                $html[] = str_repeat("t", ( count($parent_stack) + 1 ) * 2) . '</ul>';
                $html[] = str_repeat("t", ( count($parent_stack) + 1 ) * 2 - 1) . '</li>';
            } elseif (!empty($children[$option['value']->comment_id])) {
                $tab = str_repeat("t", ( count($parent_stack) + 1 ) * 2 - 1);

                // HTML for comment item containing childrens (open)
                $html[] = sprintf(
                        '%1$s<li id="li_comment_%2$s">' .
                        '%1$s%1$s<div><span class="comment_date">%3$s</span></div>' .
                        '%1$s%1$s<div style="margin-top:4px;">%4$s</div>' .
                        '%1$s%1$s<a href="#" class="reply_button" id="%2$s">reply</a>', $tab, // %1$s = tabulation
                        $option['value']->comment_id, //%2$s id
                        $option['value']->comment_text, // %4$s = comment
                        mysql_to_php_date($option['value']->comment_date) // %5$s = comment created_date
                );
                //$check_status = "";
                $html[] = $tab . "t" . '<ul class="comment">';

                array_push($parent_stack, $option['value']->parent_id);
                $parent = $option['value']->comment_id;
            } else {
                // HTML for comment item with no children (aka "leaf")
                $html[] = sprintf(
                        '%1$s<li id="li_comment_%2$s">' .
                        '%1$s%1$s<div><span class="comment_date">%3$s</span></div>' .
                        '%1$s%1$s<div style="margin-top:4px;">%4$s</div>' .
                        '%1$s%1$s<a href="#" class="reply_button" id="%2$s">reply</a>' .
                        '%1$s</li>', str_repeat("t", ( count($parent_stack) + 1 ) * 2 - 1), // %1$s = tabulation
                        $option['value']->comment_id, //%2$s id
                        $option['value']->comment_text, // %4$s = comment
                        mysql_to_php_date($option['value']->comment_date) // %5$s = comment created_date
                );
            }
        }

        // HTML wrapper for the comment (close)
        $html[] = '</ul>';
        return implode("rn", $html);
    }



Heart Heart ,
Mekaboo


  Routing question
Posted by: ronniebel - 08-01-2019, 08:11 AM - Forum: General Help - Replies (6)

I installed CodeIgniter in my root domain and I'm building my first web app. However, I have a folder of another web app (Sitelok) in that domain as well. However, Sitelok is not loading to its log in screen and I suspect it's related to my routing in the CodeIgniter app. How do I fix this?


  PHP 7.3.8 Has been Released
Posted by: InsiteFX - 08-01-2019, 05:50 AM - Forum: Lounge - Replies (1)

PHP 7.3.8 Has been Released



This is a Security and Bug Fix Update


  Compress to certain size
Posted by: kelapamuda - 08-01-2019, 03:54 AM - Forum: General Help - Replies (1)

Hello, is there any ways to do this in CI ?
User upload a picture, than he choose from radio button ,example 100 kb,500 kb,1000 kb, then the picture compress to that size, and the user now is then download it.
Thank you all.


  How to Run/maintain "one" CI3 App hosted on multiple subdomains/ servers.
Posted by: bartMommens - 08-01-2019, 02:42 AM - Forum: General Help - Replies (4)

Hi,

A year ago i've started developing an application in CI3. The general idea behind this was that every client would have a seperate (sub)domain with their version of the application/db (stand-alone) so each client worked in his own "bubble" with no connection to the others. Now a year later the amount of clients is growing and I currently have 10 subdomains with running the app.

This is becoming a bit complicated to maintain when I want to update the app(s). I've been looking at deployment tools and services and i'm a bit lost here  Huh . My goal is to simultaneously update all my subdomains when i push to my git repo. and have the least amount of downtime. (Some of the clients have the application running on their own servers as well). Is there anyone with some experience with a similar problem / case?

Alternatively i was think about putting the base source-code of the application outside the www/ folder and have all the subdomains use this code. So basically have a index.php in a subdomain where i include some constant variables which contain the config variables and the database connection information so it all uses one codebase (like codeigniter does with system folder). But i'm not sure that this is a good approach because well first of all passing constants in the index file (security risk?), one codebase -> one error and all clients are affected instead of one! And performance issues.

As you might notice i have no idea what the best approach here will be. Advice on this matter would be very appreciated! Are there people who faced the same issue or who know how to handle these kinds of things. Any form of help is welcome, advice, tutorials, ...

Thanks in advance!

Best regards,
Bart



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.