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

Username/Email:
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 12,320
» Latest member: nandhinichandran
» Forum threads: 68,561
» Forum posts: 427,554

Full Statistics

Latest Threads
how to pass array of chec...
Forum: General Help
2 hours ago
» Replies: 0   » Views: 12
CI 3.1 for Website Buildi...
Forum: Choosing CodeIgniter
3 hours ago
» Replies: 6   » Views: 3,630
Introducing TastyIgniter ...
Forum: Spotlight
4 hours ago
» Replies: 20   » Views: 22,265
Hours spent on computer?
Forum: Lounge
5 hours ago
» Replies: 32   » Views: 12,548
Do you have a hobby?
Forum: Lounge
5 hours ago
» Replies: 26   » Views: 9,520
automatic logout after in...
Forum: General Help
8 hours ago
» Replies: 0   » Views: 35
Shopping cart library not...
Forum: CodeIgniter 2.x
8 hours ago
» Replies: 1   » Views: 27
Which web hosting to use
Forum: Lounge
Yesterday, 02:58 PM
» Replies: 29   » Views: 14,631
How many pets do you own?
Forum: Lounge
Yesterday, 02:51 PM
» Replies: 10   » Views: 4,534
Which browser do you guys...
Forum: Lounge
Yesterday, 02:48 PM
» Replies: 44   » Views: 12,090

 
  CI4 - session not persisting
Posted by: happyape - 10-18-2018, 11:08 AM - Forum: CodeIgniter 4 Support - Replies (6)

I just uploaded a test site on an ubuntu server and it seems that session data is not being persistent.

e.g. mydomain/home/test/?ds=set&key=name&val=xyz would print the $ss with the value of key and val. However, I back to mydomain /home/test without ds=set querystring - it should print the session value set in the previous request but its empty.

Code:
   $ds = $this->request->getGet('ds');
   $key = $this->request->getGet('key');
   $val = $this->request->getGet('val');
   if($ds == 'set') {
       $data[$key] = $val;
       session()->set($data);
       }
       $ss = session()->get();
   print_r($ss);

I cleared all files from writable/session folder and if I refresh site page it creates a session file in there. I also noticed that every page refresh creates a new session file in this folder. I am not sure what's going wrong here. Is this a permissions issue?
The session file (in writable/session folder) has permission 600 i.e. group has read/write.

Is that causing an issue? I am not sure. How do I fix it?


  Global variable in overrided Controller
Posted by: imabot - 10-18-2018, 06:06 AM - Forum: Model-View-Controller - Replies (2)

I override the CI_Controller with MY_Controller. It works fine (now) and I wonder if I can create a variable that would be accessible everywhere else in the project (Controllers, Models, Views, Libraries ...)

Sessions will do the job but will not be the best options, since variables will be keep from one page to another.


  Forum is bugging ?
Posted by: imabot - 10-18-2018, 06:02 AM - Forum: Lounge - Replies (2)

Since a few days, the forum is not properly displayed in my browser :

Capture


  Using a .yml (or other file) to dynamically assign config.php values
Posted by: DyingDutchman - 10-18-2018, 02:41 AM - Forum: General Help - Replies (2)

I got some experience in Symfony, and i am used to being able to fill in config values after the first composer install command, and since CI supports some Symfony modules, i guessed it would be possible here as well. Thing is, i can't call the Yaml library in the config file, and editing it after the file is loaded is hardly recommended. 

I imagine there must be some way to use a yml, json or xml file to externally load in configuration settings that have been defined in a composer install/update command. If there are any other ways that i can easily manage my project so that people can pull in the git and during installation go through the configs without having to edit the config files themselves, that would be nice.


  Ajax login form token Vs normal login
Posted by: Pawan6161 - 10-17-2018, 01:39 PM - Forum: Addins - Replies (2)

Hello skunkbad

I need to ask you can we use ajax login and normal login together ?? 
why the form_open function create different name for token  below is my code above is ajax and below is normal submit form

Code:
<form action="http://localhost/atio/auth/ajax_attempt_login" id="login-form" method="post" accept-charset="utf-8">
<input type="hidden" name="loginToken" value="6253226d" />
                            <input type="text" name="login_string" id="login-string" class="form-control" placeholder="Username">
                            <input type="password" name="login_pass" id="login-pass" class="form-control form_input password" placeholder="Password"  autocomplete="off" readonly="readonly" onfocus="this.removeAttribute('readonly');" />
                            <input type="hidden" id="max_allow_attempts" value="5" />
                            <input type="hidden" id="mins_hold" value="10" />
                            <input type="submit" class="btn btn-default" value="Login" id="submit-button">
                            <a href="#" class="btn btn-link">Forgot Password?</a>
                        </form>
<form action="http://localhost/atio/login?redirect=" class="std-form" method="post" accept-charset="utf-8">
<input type="hidden" name="loginToken" value="6253226d" />
  <div>
    <h2>Login</h2>
    <section>
        <div class="row">
            <div class="col-sm-12">
            <input type="text" class="form-control" name="login_string" id="login_string" placeholder="Username" autocomplete="off" maxlength="255" required />
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <input type="password" name="login_pass" id="login_pass" class="form-control" placeholder="Password" autocomplete="off" readonly="readonly" onfocus="this.removeAttribute('readonly');" />
            </div>
        </div>
    </section>
    </div>
    <hr class="mt30">
    <input type="submit" class="btn btn-default pull-left" name="submit" value="Login" id="submit_button" />
    <a href="#" class="pull-right">Can't access your account?</a>
</div>
</form>



 You can see both form have same name for token which is loginToken , But when i place the ajax form in different form it give me below output with token name token
Code:
<form action="http://localhost/atio/auth/ajax_attempt_login" id="login-form" method="post" accept-charset="utf-8">
<input type="hidden" name="token" value="5f7abfdd" />
                            <input type="text" name="login_string" id="login-string" class="form-control" placeholder="Username">
                            <input type="password" name="login_pass" id="login-pass" class="form-control form_input password" placeholder="Password"  autocomplete="off" readonly="readonly" onfocus="this.removeAttribute('readonly');" />
                            <input type="hidden" id="max_allow_attempts" value="5" />
                            <input type="hidden" id="mins_hold" value="10" />
                            <input type="submit" class="btn btn-default" value="Login" id="submit-button">
                            <a href="#" class="btn btn-link">Forgot Password?</a>
                        </form>

 
I want to use external js for ajax submission  instead of passing jquery code to view everytime.

Why the From_token is empty..

PHP Code:
string     Pawan6161
 password   
= @#[email protected]#
 
form_token 
 
token_jar  = ["2bafb732"


  defined('BASEPATH') OR exit('No direct script access allowed');
Posted by: imabot - 10-17-2018, 11:04 AM - Forum: Model-View-Controller - Replies (6)

Should the following line be added in

  • controllers ?
  • and/or models ?
  • and/or views ?

PHP Code:
defined('BASEPATH') OR exit('No direct script access allowed'); 


  Overriding core classes
Posted by: imabot - 10-17-2018, 09:53 AM - Forum: Model-View-Controller - Replies (8)

I tryed to override the core controller following this page :
https://www.codeigniter.com/userguide3/g...asses.html

I added a new class in /application/core/ 


PHP Code:
<?php
class MY_Controller extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        echo 'Hello !';
        die();
    }


I checked, line 374 of /system/core/CodeIgniter.php is called properly :


PHP Code:
require_once APPPATH.'core/'.$CFG->config['subclass_prefix'].'Controller.php'


But constructor is not called. What am I doing wrong ?


  Codeigniter and dropzone
Posted by: HarrysR - 10-16-2018, 02:47 PM - Forum: General Help - No Replies

Hello,
I didn't know where else to ask this so i will ask it here.
I'm trying to create a form submission where the user will be able to upload some photos and then using the appropriate function to be uploaded in two different tables by grabbing the first of an array etc... etc... .

The thing is that instead of having two different file inputs (single and multiple) i've tried using dropzone. I managed to get it on some point but my main question is the following. Without adding dropzone class to form class (in order not to make the whole form clickable) and doing it like the one in my pastebin, will it be able to transfer files through controller (which is not ready yet so there might be some mistakes)?
 
Here's the pastebin since the code is kinda big and didn't know which one is most important for you guys.
https://pastebin.com/ZhvpYmVN

If you guys have faced something like this in the past and have any other solutions on that please feel free to suggest! What i wanna achieve is to grab an array of photos, inserting the first one in a single db table and all the others in another one. That's why i need the reorder function so the user to be able to choose the first picture.

Thank you in advance!


  How to access CI model in a plain php file?
Posted by: happyape - 10-16-2018, 08:27 AM - Forum: CodeIgniter 4 Support - Replies (5)

I have file at this location of my CI4 project

Code:
CI4/public/star/ratings.php

My model file is at
Code:
CI4/Application/Models/StarModel.php

Is it possible to access this Model in the ratings.php?

I tried

Code:
<?php
use App\Models\StarModel;
$starmodel = new StarModel();
?>

I expected it not to work and it didn't. I know I need to get the namespace structure right. What's the correct way? Thanks


  form validation in_list
Posted by: sh1ny - 10-16-2018, 08:17 AM - Forum: General Help - Replies (2)

Hi,

Is there any way to pass an array into in_list[] form validation?

i.e. If I want to verify a value returned from a form exists in a DB column, and I get the column values as an array of values (no keys), is there a way to get in_list to read the array rather than hardcoding the values?

Thanks



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