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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,636
» Latest member: suge.nagoya
» Forum threads: 65,996
» Forum posts: 414,444

Full Statistics

Latest Threads
Community Auth - a databa...
Forum: Addins
3 hours ago
» Replies: 16   » Views: 578
Last URI segment is zero ...
Forum: General Help
4 hours ago
» Replies: 2   » Views: 46
Community Auth - Database...
Forum: Addins
4 hours ago
» Replies: 5   » Views: 88
modify calendar library
Forum: Libraries & Helpers
9 hours ago
» Replies: 3   » Views: 149
How to handle DB connecti...
Forum: General Help
Today, 05:33 AM
» Replies: 5   » Views: 218
Codeigniter Search and fi...
Forum: General Help
Today, 05:11 AM
» Replies: 4   » Views: 258
New developer to complete...
Forum: Jobs
Today, 04:59 AM
» Replies: 4   » Views: 461
need help about database ...
Forum: General Help
Today, 04:42 AM
» Replies: 2   » Views: 95
How CodeIgniter close db ...
Forum: Libraries & Helpers
Today, 04:12 AM
» Replies: 2   » Views: 207
Codeigniter Website Showi...
Forum: General Help
Today, 02:58 AM
» Replies: 10   » Views: 386

 
  Final Year Project - Title Suggestions
Posted by: ci_lover - 05-11-2017, 10:16 PM - Forum: Lounge - Replies (1)

Hai All,

I'm a Computer Science student and have to complete my final year project. I am looking for title suggestions as this actually seems to be the most complicated aspect of the whole project.
Big Grin Big Grin

Im going to develop with CodeIgniter . I hope someone can help me Smile!


  How CodeIgniter close db connections?
Posted by: mouhong - 05-11-2017, 08:48 PM - Forum: Libraries & Helpers - Replies (2)

I'm wondering how CodeIgniter close db connections. In the doc, it says "CodeIgniter intelligently takes care of closing your database connections". But how does CodeIgniter do this? Seems I didn't find the db driver's "close" method get called in CodeIgniter 3.0.3 source code.

I've also posted in StackOverflow: http://stackoverflow.com/questions/43922...onnections

Thanks!


  CSS Expert? Need a second pair of eyes on this...
Posted by: skunkbad - 05-11-2017, 02:56 PM - Forum: Lounge - Replies (2)

I'm playing around with bootstrap 4 (yes, it's alpha), but my CSS issue really doesn't have anything to do with bootstrap.

See: http://suvovu.com

Under the "My Account" menu item, if using a screen with width > 768px, there is a submenu that you can't see. It's an absolutely positioned element. I want to see it. Why can't I see it?

Menu is basic nested list:


Code:
<nav id="menu">
    <ul>
        <li>
            <a href="#"><i class="fa fa-chevron-right"></i>Home</a>
        </li>
        <li>
            <a href="#"><i class="fa fa-chevron-right"></i>Service</a>
        </li>
        <li>
            <a href="#"><i class="fa fa-chevron-right"></i>Maintenance</a>
        </li>
        <li class="submenu">
            <button type="button" id="sub-menu-toggle">
                My Account<i class="fa fa-caret-down"></i>
            </button>
            <ul>
                <li>
                    <a href="#"><i class="fa fa-chevron-right"></i>Sign In To Access Awesome</a>
                </li>
                <li>
                    <a href="#"><i class="fa fa-chevron-right"></i>Register</a>
                </li>
            </ul>
        </li>
        <li>
            <a href="#"><i class="fa fa-chevron-right"></i>Contact</a>
        </li>
    </ul>
</nav>

CSS is a little too much to post here, but being that it's a responsive design, and was designed mobile first, I've done everything that should be necessary to see the submenu. Just can't see it. CSS:

http://suvovu.com/css/style.1494535584.css

If anyone can help, I'd appreciate it.


  Search by Zip Code and Distance
Posted by: tom756 - 05-11-2017, 11:38 AM - Forum: General Help - Replies (5)

In CodeIgniter, what would be a good way to implement a search by Zip Code feature that also incorporated results a certain distance from Zip Code.

For example, a user might input their zip code and also select an option "Within 20 miles".

Then the results page would show results starting from closest to their zip code, and then list places further away ordered by distance up to 20 miles away.

There is an example on this page where it says: Search by Location. See  http://www.catholictherapists.com


On the example page, the location search also lets users search by city and state, and it has some auto-complete feature that starts suggesting places when you start typing a zip code ( and it says it is powered by Google).
Ideally I want to replicate some thing like this search by location, and the result page it produces.


  New Layout/Template Library
Posted by: vincent78 - 05-11-2017, 09:19 AM - Forum: Addins - Replies (2)

Hello everyone,

I've just created a Layout/Template Library.
It allows you to:

  • manage your templates: include template, extend template ...
  • manage your views: set the title, set the template, add css and javascript files ...

It's really easy to install and use !

Get it on github: CodeIgniter Layout Library

Have a good day !
Vincent


  Codeigniter form validation in config depends on another input
Posted by: vahid.vdn - 05-11-2017, 08:24 AM - Forum: CodeIgniter 3.x - Replies (1)

I'm using Codeigniter form validation by config (not setting rules manually). What I need, is setting required rule depending on the other field. For example, Imagine we have the following rules:


Code:
'user' => array(
   array(
       'field' => 'user[phone]',
       'rules' => 'required'
   ),
   array(
       'field' => 'user[email]',
   ),
   array(
       'field' => 'user[foo]',
       //'rules' => 'required'
   )
),

foo input must be required based on email field.
Note: It can be done with callback or anonymous function, but it makes it a bit difficult in big applications. Any idea?


  Task Scheduler
Posted by: Rubenvh - 05-11-2017, 06:29 AM - Forum: CodeIgniter 4 Feature Requests - Replies (6)

I'm looking for a way to setup 1 cron job on the server and let the framework do the rest.

There are some libraries on GitHub that try to achieve this, but they don't work perfectly with CodeIgniter.
https://github.com/lavary/crunz
https://github.com/jobbyphp/jobby

I also found out that Laravel has such a task scheduler...
https://laravel.com/docs/5.4/scheduling

Are there any plans or is there enough interest in such a feature?


  popup data to edit in ckeditor
Posted by: sumant - 05-11-2017, 04:29 AM - Forum: General Help - Replies (2)

i am submitting data using input text box and ckeditor  and i want to popup data to edit in text box and ckeditor but facing errors while do this... please help me...
my view code is:
<?= form_open('admin/update_post'); ?>
<?php //echo form_hidden('author',$this->session->userdata('username'));?>
<div>
<label for="Title">
<span class="required"><h4>Subject</h4></span>

<?= form_input(['name'=>'sub_heading','placeholder'=>'Your Title','tabindex'=>2,'value'=>set_value($post->sub_heading)]); ?>
</label>
</div>


<div>
<label for="content">
<span class="required"><h4>Content</h4></span>

<?php echo $this->ckeditor->editor('sub_desc',@default_value);?>

</label>
</div>
<div>

<!-- <input type="submit" name="sub" id="sub" value="SEND"> -->
<?= form_submit(['name'=>'submit','id'=>'sub','value'=>'POST']); ?>
</div>
<?= form_close(); ?>



Thanks in advance


  Creating a referral url
Posted by: valkaycelestino - 05-10-2017, 01:24 PM - Forum: General Help - Replies (8)

I need to create a referral url for every member of my site, something like this: http://mywebsite.com/ref/user, where user is a unique field in a database table. Please can someone give me a hint on how to go about this? I'll appreciate a dummy code, since I'm new to PHP and CodeIgniter.

I did some digging on the internet and found this code on github:

   

Code:
<?php
      //check for referal links
      function referal()
      {
       $CI =& get_instance();
       $cookie_value_set = $CI->input->cookie('_tm_ref', TRUE) ? $CI->input->cookie('_tm_ref', TRUE) : '';
      if ($CI->input->get('ref', TRUE) AND $cookie_value_set == '') {
        // referred user so set cookie to ref=username
         $cookie = array(
        'name'   => 'ref',
        'value'  => $CI->input->get('ref', TRUE),
        'expire' => '7776000',
      );
        $CI->input->set_cookie($cookie);
        return TRUE;
       }elseif ($cookie_value_set == '') {
         $cookie = array(
        'name'   => 'ref',
        'value'  => 'sso',
        'expire' => '15552000',
      );
        $CI->input->set_cookie($cookie);
        return TRUE;
    
       }elseif ($cookie_value_set != '') {
         //already referred so ignore
        return TRUE;
    
       }else{
          return TRUE;
       }
      }
    //end of hooks file
    ?>

The owner of the gist only mentioned saving the file as referral.php inside the **hook** folder. This is not helping me with what I want to achieve, I don't know how to use the code:
1. How do I pass the **referrer** field to the variable **username** from the **users** table?
2. How do I load the hook file to view (register.php)?
3. How and where do I call the hook file?

So can anybody give me an insight?


  Disable CSRF on page using router
Posted by: justanotherprogrammer0 - 05-10-2017, 11:16 AM - Forum: Issues - No Replies

I have one page that receives post data from another website, so I need to be able to whitelist this particular page to disable CSRF.  While Codeigniter has an option `$config['csrf_exclude_uris']` for this, this doesn't seem to be working in my scenario because I am using a router to get to this page.  Is there a way to make `csrf_exclude_uris` look at the determined controller/method rather than at the original url?

Example:

Post URL:

Code:
mysite.com/1234/test1

Routing rule: 
PHP Code:
$route['(:num)/(:any)'] = 'portal/index/$1/$2'

Want to do: 
PHP Code:
$config['csrf_exclude_uris'] = ['portal/index']; 

Rather not do, but does work: 
PHP Code:
$config['csrf_exclude_uris'] = ['(\d+)(\/)((?:[a-z][a-z]+))']; 


The problem is the Security class seems to look at `1234/test1` rather than `portal/index`.  Is there a way around this?  Is there a disadvantage to not using the actual controller/method?  From my tests, it appears portal and index are known before the whitelist check is applied.

Running CI 3.1.3. From the release notes, it doesn't look like 3.1.4 changed anything here.



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