Welcome Guest, Not a member yet? Register   Sign In
  Libraries in subfolders
Posted by: El Forum - 07-01-2008, 02:39 AM - Replies (9)

[eluser]Dave Stewart[/eluser]
I've tried this, and it appears not to work. Is this the case?
Cheers,
Dave


  Route URL Question
Posted by: El Forum - 07-01-2008, 01:38 AM - No Replies

[eluser]Unknown[/eluser]
Hello All

How to implement shortcut url in codeigniter?

Example:
http://myspace.com/rnrm it is routed to the rnrm home profile.
http://myspace.com/signin it is routed to the signin controller
http://myspace.com/invalid it is an 404 error because invalid is not a valid profile or it is not a valid controller

I have modify route configuration like this:

Code:
$route['(.*)']='url/profile/$1';

And this is sample controller to determine if the url is valid or not:
Code:
class Url extends controller {
    function profile($url)
        if (isValidProfile($url)){
            $this->load->view('theprofile');
        }else{
            if(isValidController($url){

                // confusing here
                // how to route/forward to the corresponding controller

            }else{
                show_404();
            }
        }
    }
}
Thx in advance...


  Need Urgent but Perfect help in jQuery and CI Integration
Posted by: El Forum - 07-01-2008, 01:15 AM - Replies (20)

[eluser]Mizanur Islam Laskar[/eluser]
Hi, I'm new in CI. I need to integrate jQuery in CI (including remote script funtions for AJAX) for my current 2 projects. Can any expert help me with a proper and complete code-snippets?

For example, I need to develope an exact thing like http://www.simplypost.ca/register_step1.php, which is created from the scratch, but I need to develope it in CI now. Play with the link to know my reqirements perfectly, like type [email protected] in the Email Address field and press TAB. Again type another email like [email protected] and pess TAB....yes, remote scripts are responsible there for that unique-validity checking. Also type both correct/incorrect digits in Captcha field, type password less than 6 char, etc.

I went through the existing wikis in this site, but nothing could not give me a solution. Plz, I'm really need this very badly....Thanks


  Unusual ActiveRecord Result
Posted by: El Forum - 07-01-2008, 12:06 AM - Replies (4)

[eluser]E303[/eluser]
I am trying to get the exhibitionId from exhibitions depending on what exhibition is viewed. Then with that exhibitionsId I want to search the gallery table to see if their is a gallery.

Code:
$url = $this->uri->segment(3);
            $this->db->select('exhibitionsId');
            $this->db->from('exhibitions');
            $this->db->where('url',$url);
            $exhibitions_list = $this->db->get();
            foreach ($exhibitions_list->row() as $row)
            {
                $this->db->select('url, title');
                $this->db->from('galleries');
                $this->db->where('exhibitId', $row['exhibitionsId']);
                $galleryExhibitions_data = $this->db->get();
                return $galleryExhibitions_data->result_array();
            }

Nothing displays like there is no record yet there is. So when I run
Code:
echo $row['exhibitionsId'];
I get the number 2. The correct number should be 25. There is no record with the number 2 so I am not sure what is happening. It seems when I try to echo out anything from the first query I get the number 2 and the result.

Thanks in advance


  controller inheritance
Posted by: El Forum - 06-30-2008, 11:42 PM - Replies (13)

[eluser]Nir Gavish[/eluser]
hi all!

is there anyone who knows of an easy, elegant way for one controller to inherit (extend) another existing controller?

Thanks, Nir


  pagination not work
Posted by: El Forum - 06-30-2008, 11:20 PM - Replies (9)

[eluser]dinda[/eluser]
I am a beginner and i currently having problem with paging and the result.
and then the searching is works, but paging is not.

Help me please...

This is my code:

Code:
/* controller : */

class Test extends Controller {
    
    function test()
    {
        parent::Controller();    
        
        $this->load->helper('url');
        $this->load->helper('form');
        $this->load->model("test_model");
        $this->load->library('pagination');
        $this->load->database();
    }
    
    function index()
    {
        
        /* Parameter Search Field */
        $data['keyword'] = false ;
        $this->test_model->keywordsearch = false;
        
        /*load pagination class */
        $config['uri_segment'] = 4;
        $config['base_url'] = base_url().'index.php/test/index/';
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $config['per_page'] = '2';
        $config['total_rows'] = $this->db->count_all('ms_user');

        $this->pagination->initialize($config);
        
        /* Model Process */
        $data['queryuser'] = $this->test_model->search_test_data($config['per_page'],$this->uri->segment(3));
        
        
        /* View Passing */
        $this->load->library('table');    
        $this->table->set_heading('ID', 'Name');

        /* Show Output */
         $this->load->view("test_list_v", $data);    
        
    }
    
    function search_test()
    {
        
        /* Parameter Search Field */
        $data['keyword'] = $this->input->post('keyword');
        $this->test_model->keywordsearch = $this->input->post('keyword');
        
        /*load pagination class */
        $config['uri_segment'] = 4;
        $config['base_url'] = base_url().'index.php/test/index/'. $this->uri->segment(3);
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $config['per_page'] = '2';
        $config['total_rows'] =  $this->db->count_all('ms_user');
        
        $this->pagination->initialize($config);
        
        $offset = (int)$this->uri->segment(4);
        
        /* Model Process */
        $data['queryuser'] = $this->test_model->search_test_data($config['per_page'], $offset);
        

         /* View Passing */
         $this->load->library('table');
         $this->table->set_heading('ID', 'Name');
        
        /* Show Output */
         $this->load->view("test_list_v", $data);    
        
    }
    
    
}

Code:
/* model : */
function search_test_data($num, $offset = false )
{
$this->db->select('userid,username');
$this->db->from('ms_user');      

if ($this->keywordsearch) {
$this->db->like("username", $this->keywordsearch);
}

if ($offset)
{
$this->db->limit($num,$offset);        
}
else
{
$this->db->limit($num);        
}
        
$this->db->order_by('userid');
        
$query = $this->db->get();

return $query;
}

Code:
&lt;!-- View --&gt;
&lt;form name="user_find" id="user_find" method="POST" action="&lt;?=site_url('test/search_test')?&gt;"&gt;
        Cari Nama User :
            &lt;input type='text' name='keyword' id='keyword' value='&lt;?= $keyword; ?&gt;'  /&gt;
            &lt;input type="submit" name="Submit" value="Find"&gt;
&lt;/form&gt;
    
echo $this->table->generate();
echo $this->pagination->create_links();


  Login by username (redux auth question)
Posted by: El Forum - 06-30-2008, 10:57 PM - Replies (2)

[eluser]markanderson993[/eluser]
Hey I'm wondering if anyone out there knows of a way to login with the redux auth code by inputting a username instead of a password. It seems a wee bit odd to ask the user for their email and password rather than their username and password :/


  how can i put all eror in same log file
Posted by: El Forum - 06-30-2008, 09:45 PM - Replies (1)

[eluser]Zeeshan Rasool[/eluser]
Hi, guys there is a little prob. Here , i have a code that generates error log file

Code:
$dbRet=$this->db->insert('hfelp_video');
             if (!$dbRet) {
             $errNo   = $this->db->_error_number();
                $errMess = $this->db->_error_message();

            log_message("error", "Problem Inserting to".$errMess." (".$errNo.")");

but, it generates new file daily with current date file name i-e

log-2008-06-30.php , log-2008-07-01.php etc

how can i put all eror in same log file

thnx in adv.


  Removing index.php from url
Posted by: El Forum - 06-30-2008, 09:09 PM - Replies (3)

[eluser]Computerzworld[/eluser]
Hello. I am having problem in removing index.php from url. I made one htaccess file for this and also removed index.php from config file like this.

Code:
$config['index_page'] = "";
Here is my htaccess code.
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|uploads|jscripts|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

This works perfectly in my windows environment but doesn't works with linux environment. In windows all the urls are without index.php and the same code I have uploaded to linux server I have to write index.php after url for the first time after it works. I don't know what is the problem behind it. Please help me. Thanks in advance.


  [1.6.3] Add Accept-Charset to Form Helper Class
Posted by: El Forum - 06-30-2008, 08:55 PM - No Replies

[eluser]Randy Casburn[/eluser]
Good Day -- I have a proposal:
Why/Problem Statement: CI constructs valid XHTML document with an HTML form. User submits form with ISO-8859-1 Latin character encoded data as part of form input. What happens to input text? If the browser is in Strict mode, the text is likely mangled since the XML specification requires the XHTML document to implement either a UTF-8 or UTF-16 character encoding. The proposal below accounts for the fact that the CI developer knows they were constructing the XHTML Strict document so the expectation in advance is a UTF-8 encoded input. The CI developer thinks this is dealt with since they made that setting in the database.php configuration file (char_set = "utf8";). Perhaps the text in the DB is still mangled.
Proposal: Add the [accept-charset = ] attribute to the &lt;form&gt; tag creation methods of the Form Help class. Use the DB config setting for 'char_set' to set the attribute value to be consistent with with CI DB configuration. This notifies the browser about acceptable character encodings the server will accept.
References:
[url http://www.w3.org/TR/html401/interact/fo...f-FORM]W3C Reference[/url]
[url http://www.cs.tut.fi/~jkorpela/chars.html]Tutorial on Charsets/Char Codes[/url]
Rationale: Many community members (~200 posts) have discovered some form of char_set difficulty. This issue is particularly difficult to fault isolate and every step CI can take to eliminate faulty links in the chain can help. It is assumed this is the rationale that led to the configuration and DB code base change regarding this same issue.
Benefit to CI: A significant portion of data generated for input into our web site databases comes from web based forms. By providing a consistent char_set CI would provide fewer char_set related trouble events.
Benefit to the Community: Charset related issues are still going to be around. Fault isolation will just be a lot easier if we're relying on the Form Helper Class to help us through this just like it helps us through automatically escaping our strings for us.
Discussion:
This is not the end game fix-it-all for char_set problems. Pls look at all the variations to this theme...

Default Charsets:
-Apache - ISO-8859-1
-PHP - ISO-8859-1
-MySQL - ISO-8859-1
-XML (XHTML) - UTF-8 (or 16)
-Windows - Windows-1252(Code Pages
-MAC - ISO-8859 Variants (depending on country)
-Linux,Unix - UTF (it depends)
-Other Charsets - BIG5, ISO-2202, etc.
-Browsers - Which mode? (quirks, strict, stupid)
-I don't mean to leave anyone out...

Every one of these 'platform's' charset is configurable. That makes it nearly impossible to determine what's coming at us unless we test every string (yuck). Simply forcing a web form to push text into a pre-defined char code isn't going to solve every problem either. For example, if a specific character code doesn't exist in the chosen char_set, you're still out of luck and likely to mangle your text anyway. (BIG5 <-> UTF-8)

What this fix would allow us to do is exactly what the same fix in the DB class allows us to do. Create consistency within the CI platform. Perhaps this a continuation of applying one char_set to the interfaces (in the OOP sense) of CI. Consistency.
---
Thoughts and comments?


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

Username
  

Password
  





Latest Threads
Codeigniter Shield Bannin...
by kenjis
2 minutes ago
Best way to create micros...
by kenjis
6 minutes ago
How to use Codeigniter wi...
by kenjis
12 minutes ago
Getting supportedLocales ...
by kcs
6 hours ago
Component help
by FlashMaster
Today, 01:41 AM
Show logo in email inbox
by WiParson
Today, 12:48 AM
Limiting Stack Trace Erro...
by byrallier
Yesterday, 02:21 PM
Bug with sessions CI 4.5....
by ALTITUDE_DEV
Yesterday, 01:36 PM
codeigniter 3.0.1 equiped...
by JustJohnQ
Yesterday, 10:05 AM
Display a custom error if...
by b126
Yesterday, 06:22 AM

Forum Statistics
» Members: 85,223
» Latest member: abdulaziz03421
» Forum threads: 77,575
» Forum posts: 375,968

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB