Welcome Guest, Not a member yet? Register   Sign In
second controller not accessible
#11

[eluser]webdevguy32[/eluser]
Right. Highly, extensively embarrassed. However, when I changed the code, cleared cache., ran the project and logged in, it error-ed out 404@
URL = /index.php/admin/administer/members
New beginning to administer class:
Code:
class Administer extends CI_Controller {
In the help files, it says:
Quote:To call the above controller your URI will look something like this:

example.com/index.php/products/shoes/show/123
Each of your sub-folders may contain a default controller which will be called if the URL contains only the sub-folder. Simply name your default controller as specified in your application/config/routes.php file

CodeIgniter also permits you to remap your URIs using its URI Routing feature.
Does this have any effect on what I am doing?
#12

[eluser]Tpojka[/eluser]
Show views/login.php to see the form.
#13

[eluser]webdevguy32[/eluser]
Here's the login that posts back to main method:
Code:
<!DOCTYPE html>
&lt;html lang="en"&gt;
    &lt;head&gt;
        &lt;meta charset="utf-8"&gt;
        &lt;title&gt;Welcome to CodeIgniter&lt;/title&gt;
        &lt;link rel="stylesheet" type="text/css" media="screen" href="styles.css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;

        <div id="container">
            <h1>Welcome to Training Navigation System</h1>
            <h3>Please login</h3>

            &lt;?php
            echo form_open('main/login_validation');
            
            //display the errors, if any
            echo validation_errors();
            
            //set up form fields
            echo "<p>Username: ";
            echo form_input('userID', $this->input->post('userID'));
            echo "<p>";

            echo "<p>Password: ";
            echo form_password('password');
            echo "<p>";

            echo "<p>";
            echo form_submit('login_submit', 'Login');
            echo "<p>";

            echo form_close();
            ?&gt;

            <p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
        </div>

    &lt;/body&gt;
&lt;/html&gt;
I am able to login and proceed through the login function. it hangs when I try to call the sub-folder controller in main/login, right before this line in main:
redirect('admin/administer/members');
#14

[eluser]Tpojka[/eluser]
Put error checker outside the form.
#15

[eluser]webdevguy32[/eluser]
Please clarify - by the way, I most sincerely appreciate your help.
#16

[eluser]Tpojka[/eluser]
Np and yw. This is the way I learn too.
Code:
echo validation_errors();
Should be above the form.
#17

[eluser]webdevguy32[/eluser]
Wasn't sure where you wanted it but I put it above the login form. It rendered the message that it does later in the form when I have that line. I added it to the controller logic and it did not change -> 404'ed out. I restarted apache and cleared cache b4.
#18

[eluser]Tpojka[/eluser]
I gave you the link "above".
Take a look where is placed echoin errors in user_guide.

Check is there same method names. Maybe one has member and other members.

Edit:

try with

Code:
if (!$this->session->set_userdata($data)) { echo "Session data not set!"; exit(); }
else redirect('admin/administer/members');
#19

[eluser]webdevguy32[/eluser]
I added it and some other more perhaps revealing code:
Code:
//set session data
            $data = array(
                'username' => $this->input->post('userID'),
                'is_logged_in' => true,
                'email' => $row['emailAddress'],
                'entityName' => $row['name'],
                'role' => 'training_admin',
                'entity_ID' => $row['entity_ID'],
                'learningPath' => $row['learning_path']
            );
            $this->session->set_userdata($data);
//display session data
    echo "<pre>";
    print_r($this->session->all_userdata($data));
    echo "<pre>";            
// it displays ALL session data            
             if (!$this->session->set_userdata($data)) { echo "Session data not set!";     echo "<pre>";
    print_r($this->session->all_userdata($data));
    echo "<pre>";   }
else redirect('admin/administer/members');
It displays:
Array
(
[session_id] => 7661b8f329adfd65fcc9f9e847ffb76b
[ip_address] => ::1
[user_agent] => Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Iron/28.0.1550.0 Chrome/28.0.1550.0 Safari/53
[last_activity] => 1382399860
[user_data] =>
[username] => myname
[verified] => 1
)
Session data not set!

Array
(
[session_id] => 7661b8f329adfd65fcc9f9e847ffb76b
[ip_address] => ::1
[user_agent] => Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Iron/28.0.1550.0 Chrome/28.0.1550.0 Safari/53
[last_activity] => 1382399860
[user_data] =>
[username] => myname
[verified] => 1
)

Note: It displays the session data, indicates there is not session data then displays it again. What in the world is going on?
#20

[eluser]Tpojka[/eluser]
It is really late for me now (CET).
I am off, I hope you'll find errors.
Eventually, if not, tomorrow we continue. Smile

GN




Theme © iAndrew 2016 - Forum software by © MyBB