Welcome Guest, Not a member yet? Register   Sign In
  WSOD Question
Posted by: El Forum - 03-13-2008, 09:20 AM - Replies (8)

[eluser]Synapse56[/eluser]
I'm developing with CI 1.6.1 under windows/apache/mysql and have a noddy app reading & writing to mysql fine.

When I move the app across to a linux box (ubuntu6.06LTS) I get the WSOD, nothing is logged to the log files or anything; the application completely dies.

I initially thought it was a problem communicating with mysql so I wrote a simple php page to open a connection outside of the CI framework, and this works fine.

If I remove database connections from the CI application the it works again, so I suspect there's something within the CI project that is barfing giving me the WSOD.

Has anyone got any suggestions please?

Thanks a lot.


  Conceptual and organisation question between Frontend and Backend
Posted by: El Forum - 03-13-2008, 08:33 AM - Replies (6)

[eluser]Référencement Google[/eluser]
Hi,

I would like to discuss about how is the best way to organize things and if you can tell me if the way I am doing things is good or if we can do better.

I actually organize the controllers between admin and frontend like that:

Code:
/Controllers
+- /admin
|  |- rates.php
|  |- page.php
|  |- gallery.php
|- rates.php
|- page.php
|- contact.php
|- gallery.php

As you can see, I have the same name of controllers for the frontend and backend, and each of them do a different job. All controllers (both front and back) are extending a MY_Controller library.

Is my way to organise things is good, or do you advice me to do things differently ?


  CI form validation in models/libraries?
Posted by: El Forum - 03-13-2008, 08:06 AM - Replies (2)

[eluser]ch5i[/eluser]
Hello,

I know this has been asked several times already, but I have not been able to find any good examples for this the forums.

Basically I want to make controller functions available to more than one controller, eg. generic listings or forms, so the way to do it would be to create own models/libraries (I guess).

I would like to shift form validation to a model or library so that I do not have to duplicate code.

Are there any good examples (using CI's validation class)?
Should I use models or libraries for this?


Thanks for any hints!


  Where is the best place to put this bit of code...
Posted by: El Forum - 03-13-2008, 07:01 AM - Replies (3)

[eluser]sanchothefat[/eluser]
Hi, I've only just started hacking around with CI. I'm not too hot on php but I get OO programming and how to use classes/methods and so on. What I'm trying to figure out how best to organise my code for a simple application I'm writing as part of a site.

My question is, say you have a section of the web page that you want on all pages of the site, but that bit has some dynamic data in it. How do you include that data across multiple controllers?

To put it in context on the site i'm working on there is a list of gig dates down the side. These are parsed from an iCal feed in my default controller. Should I create a public method to collect the data and call it in each controller and then just include the appropriate sub-view in the controller's main view file? If so where/how would you define that method?

Hopefully that makes some sense...

Cheers


  uri->segment(n) - a question
Posted by: El Forum - 03-13-2008, 05:39 AM - Replies (6)

[eluser]soupdragon[/eluser]
A slightly strange problem here
url
...codeigniter/user/confirm/ACT/dGhlc291cGRyYWdvbkB3ZWJpdGFsLmRl

started with this which didnot work
if(($this->uri->segment(3,0) == 'ACT')&&($this->uri->segment(4,0) != 0)) {
$check = $this->usernorm_model->confirmnewuser($this->uri->segment(4,0));
}

so tying to find out why i've now ended up with

$thecode = $this->uri->segment(4,0);
if($thecode == 0) {
echo "wtf $thecode";
}

the weird bit is i get echoed out
wtf dGhlc291cGRyYWdvbkB3ZWJpdGFsLmRl

anyone got a quick explanation about this ? or am i being a bit dim today


  Would you use CI for this?
Posted by: El Forum - 03-13-2008, 04:00 AM - Replies (14)

[eluser]Puzzled1[/eluser]
Hello everyone!

I am unsure what software to use for a project I'm about to start.
It's supposed to be a database-driven contact management tool, managing about 16.000 to 20.000 addresses.

The requirements are what pose some problems for me:
* Apart from the fields you would expect (name, firstname, mail, city, street, etc), there also will have to be a few fields that group the contacts by group membership or certain other attributes - let's call them tags for now.
* The number of those tags and groups is unknown to me and will increase over time
* This also means that those tags and groups have to be kinda dynamic. New tags will come up. One MySql-SET field will probably not be enough.
* There won't be any need for user-to-user-relationships.
* 16.000 addresses seems like a lot.
* Search results should be exported in an Excel-Sheet (shouldn't be a problem)
* New addresses should be added by uploading an Excel-Sheet.
* Said uploads should not lead to double entries in the databank.

So... would you guys use CodeIgniter for this project? Did someone program anything like this before?

Right now I'm not even sure what to use as a primary key and how to make sure that 2 persons with the same name are or aren't one and the same. This problem is amplified by the fact that I won't have all the information all the time. Sometimes name and e-mail address will be everything I have, other times name, address and phone number will be there but no mail.

Sorry if I'm in the wrong forum.

Thanks for any hints, thoughts and criticisms.


  Auth control by uri request
Posted by: El Forum - 03-13-2008, 03:51 AM - Replies (12)

[eluser]FlashUK[/eluser]
I just had an idea about some code that could be used for a Auth library.

Controlling access to a controller/section by using the uri_string

This data could be stored into the database (group_id & request_uri). There is then no need to hardcode a group id into the page, just simply match it against the database.

Table layout I thought of for MySQL:

Code:
group_id | request_uri

It would also allow you to add access to other controls easily as you create them, or give a group more privileges via a admin panel.

If you wanted, you could use "/" as the request_uri for the group_id if you want to allow access to ALL controllers throughout the site (obviously for someone like "Super Admins" only).

What do you guys think? Any flaws?


  ajax problem in IE, works in firefox, but error shows up as PHP error
Posted by: El Forum - 03-13-2008, 03:45 AM - Replies (1)

[eluser]Circus-Killer[/eluser]
Hey there.
I am currently working on the registration section of a website. there are two select boxes. one that will allow you to choose a region, another to choose a department. everytime a region is selected/changed, the department list must reload from the database the list of departments in that specific region. i have it running in firefox with no problem, but when i try run it in ie7 i get php errors.

here is the ajax script:

Code:
function ajaxFunction(){
    document.registration.deps.disabled = false;
    var ajaxRequest;  // The variable that makes Ajax possible!
    
    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
    
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
        if(ajaxRequest.readyState == 4){
            document.getElementById('dep_options')[removed]=ajaxRequest.responseText;
        }
    }

    ajaxRequest.open("GET", "http://localhost/index.php/ajax/get_deps/" + document.registration.region.options[document.registration.region.selectedIndex].value, true);
    ajaxRequest.send(null);
}

and the codeigniter controller it calls:
Code:
<?php
class Ajax extends Controller{
    function get_deps(){
        $this->load->model('ajax_model');
        $deps = $this->ajax_model->get_deps($this->uri->segment(3));
        $response = '<select name="deps">';
        if ($deps->num_rows() > 0){
            foreach ($deps->result() as $row){
                $response = $response.'<option value="'.$row->id.'">'.$row->name.'</option>';
            }
        }
        else{
            $response = $response.'<option value="">--</option>';
        }
        $response = $response.'</select>';
        echo $response;
    }
}
?&gt;

and the model:
Code:
&lt;?php
class Ajax_model extends Model{
    function __construct(){
        parent::Model();
        $this->load->database();
    }
    
    function get_deps($region_id){
        $query = $this->db->query("SELECT id, name
                                FROM departments
                                WHERE region_id = ".$region_id);
        return $query;
    }
}
?&gt;


  captch & sessions
Posted by: El Forum - 03-13-2008, 02:12 AM - Replies (6)

[eluser]Lupin[/eluser]
Hi all,
this is my first project with CI & i have encountered a weird problem.
i am using an AUTH class with captcha, i store the captcha string in a session
but for some reason the session string changes & is not cmpatible with the captcha string.

Code:
if (isset($_POST['submit'])){
    // check captch string
    if($this->session->userdata('cap_code') != $_POST['security_code'] ){
        $data['err'] = 'no match';
    }else{
    
    }

}

// Generate captch code & insert into session
$data['code'] = $this->_generateCode();
$this->session->set_userdata('cap_code',$data['code']);

any ideas?


  How to config route ??
Posted by: El Forum - 03-12-2008, 11:50 PM - Replies (6)

[eluser]Le Bang[/eluser]
i have two controller: admin.php, root.php.

If accessed into http://mysite.com/index.php/admin then it will call controller admin.php Contrariwise I wish all call diplay uniformization root.php. I have to how to set up route


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

Username
  

Password
  





Latest Threads
Error / Shield 1.0.3 + Ci...
by kenjis
1 hour ago
Integrating Bootstrap 5 i...
by tarcisiodev1
2 hours ago
Asset Minification Packag...
by tarcisiodev1
2 hours ago
Modify users data as an a...
by luckmoshy
3 hours ago
Is it possible to go back...
by ejimenezo
8 hours ago
SQL server connection not...
by davis.lasis
Today, 07:11 AM
Validation | trim causes ...
by Gary
Today, 05:09 AM
Problem with session hand...
by Julesb
Today, 04:13 AM
External script access to...
by PomaryLinea
Today, 03:58 AM
VIRUS reported after Chro...
by InsiteFX
Yesterday, 11:34 PM

Forum Statistics
» Members: 85,496
» Latest member: fcb8ist
» Forum threads: 77,586
» Forum posts: 376,025

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB