Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:19:24+00:00 2026-06-13T22:19:24+00:00

So, all I’m trying to do is submit a few values to a database

  • 0

So, all I’m trying to do is submit a few values to a database from form input.

I have a controller clientcreation.php:

<?php

class Clientcreation extends CI_Controller
{
  function index(){
     $this->load->view('files/header',$clientRegistration);
     $this->load->view('files/navigation');
     $this->load->view('pages/clientcreation');
     $this->load->view('files/footer');

    ## validation rules here working fine.

     $this->form_validation->set_rules($RegistrationRequiredFields);
        ## Perform Validation
        if ($this->form_validation->run() == FALSE){
             echo validation_errors();             ## show the errorneous fields
        }

    else{
            #### load :: models
            $this->load->model('pages/clientcreationmodel','',TRUE);
                ## get [hashed] inputted pass and submit.
                $this->Clientcreationmodel->hashed_client_pass_and_submit();
            # then, load success page:
            $this->load->view('pages/success/clientRegistrationSuccess');
    }



  }

}

a model clientcreationmodel.php:

<?php
class Clientcreationmodel extends CI_Model{
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }

    function hashed_client_pass_and_submit(){
        ## create hashed version of client inputted [pass]
    /*    
        $initialVal = $_POST['pass'];
        $HashedPassVal = hash('sha512', $initialVal);
        $SaltValue = mcrypt_create_iv(10, MCRYPT_DEV_URANDOM);
        $finalHashedValue = $HashedPassVal.$SaltValue;
    */    
        ## process and insert into db
        $this->input->post('email', TRUE);     
        $this->input->post('pass', TRUE);
        $this->input->post('fname', TRUE);
        $this->input->post('lname', TRUE);
        $this->input->post('title', TRUE);
        $this->input->post('co', TRUE);
        $this->input->post('phone', TRUE);
        $this->input->post('state', TRUE);  
        $this->input->post('numapps', TRUE);
        $this->input->post('versCntrl', TRUE);
        $this->input->post('testFreq', TRUE);
        $this->input->post('submit');

        $this->db->insert('client', $this);
   }

}
?>

a view clientcreation.php:

<?php
    echo form_open('index/pages/clientcreation',$CustCreationFormAttr);
    echo form_label('Email: ','email');
        echo form_input($CustCreationEmail);echo '<br>';
    echo form_label('Password: ', 'pass');echo '<br>';
        echo form_password($CustCreationPassword);echo '<br>';
    echo form_label('Password Confirm: ', 'passConf');echo '<br>';
        echo form_password($CustCreationConfPassword);echo '<br>';
    echo form_label('First Name: ','fname');echo '<br>';
            echo form_input($CustCreationFirstName);echo '<br>';
    echo form_label('Last Name: ','lname');echo '<br>';
            echo form_input($CustCreationLastName);echo '<br>';
    echo form_label('Title: ', 'title');echo '<br>';
            echo form_input($CustCreationClientTitle);echo '<br>';
    echo form_label('Company: ', 'co');echo '<br>';
            echo form_input($CustCreationCompany);echo '<br>';
        echo form_label('Phone: ','phone');echo '<br>';
            echo form_input($CustCreationPhone);echo '<br>';
    echo form_label('State: ','state');echo '<br>';
            echo form_dropdown('states',$CustCreationState,'Alabama');echo '<br>';
    echo form_label('Number of Applications: ','numapps');echo '<br>';
            echo form_input($CustCreationNumApps);echo '<br>';
    echo form_label('Version Control: ','versCntrl');echo '<br>';
            echo form_dropdown('versCntrl',$CustCreationVerCntrl,'Subversion'); echo '<br>';
    echo form_label('How often do you test? ','testFreq');echo '<br>';
            echo form_dropdown('freq',$CustCreationTestFreq,'Daily');echo '<br>';
    echo form_submit($CustCreationSubmit,'Submit');    
?> 

but after i submit I get the following error:
img2

Is it throwing this error because the file clientcreationmodel.php isnt the same naming convention of clientcreation.php as with the view and controller ?

If I try to modify the model class in the model as class Classcreation extends CI_Model{} it throws the error: Fatal error: Cannot redeclare class Clientcreation . What should I do here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:19:25+00:00Added an answer on June 13, 2026 at 10:19 pm

    once you load your model, you will spell the instance with a lowercase c

    so in your controller, it would be

    $this->clientcreationmodel->hashed_client_pass_and_submit();
    

    notice its lowercase now.

    also, the loader for the models second parameter shouldn’t be ” and you don’t need to set the 3rd parameter at all. You can do this and it should work fine. The second parameter is used to set a different object name than default. So this should work fine.

    $this->load->model('pages/clientcreationmodel');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
All, If I've go the following database fields/values: user_id field_name field_value 1 EventHour1 1
All, I have the following code: $fetch = mysql_query(SELECT * FROM calendar_events where event_status='booked'
All, We could really do with some advice from SVG gurus. WHAT WE HAVE:
All, I have a form with a MultiValueField that almost works. It uses a
All- I have the following code: class AddStringTask extends AsyncTask<Void, String, Void> { @Override
All, I'm inserting some text from a textarea in a mySQL database. I'm using
All I'm trying to do is something fairly simple : Create a class (let's
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.