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 8815577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:24:51+00:00 2026-06-14T04:24:51+00:00

The form is duplicating in a page. I cant upload the picture though:( I

  • 0

The form is duplicating in a page. I cant upload the picture though:(
I dont remember having any loop for that. I badly need help. This is my

view_register.php

 <body>


<h1>IMAGE HERE</h1>

<div id="body">
    <br/>

    <p class="body">
    <!--trial-->
    <?php
    echo form_open('start');
    $firstname = array(
    'name'  =>  'firstname',
    'value' =>  set_value('firstname')
    );

    $lastname = array(
    'name'  =>  'lastname',
    'value' =>  set_value('lastname')
    );

    $email = array(
    'name'  =>  'email',
    'value' =>  set_value('email')
    );

    $dateofbirth = array(
    'name'  =>  'dateofbirth',
    'value' =>  set_value('dateofbirth')
    );

    $gender = array(
    'name'  =>  'gender',
    'value' =>  set_value('gender'),
    'style' =>  'margin:10px'
    );

    $username = array(
    'name'  =>  'username',
    'value' =>  set_value('username')
    );

    $password = array(
    'name'  =>  'password',
    'value' =>  ''
    );

    $confpass = array(
    'name'  =>  'confpass',
    'value' =>  ''
    );


    ?>

    <!--trial ends here-->

    <strong>User Information: </strong>
    &nbsp;
    <div align="right"><font color="red">*</font>Denotes Required Field</div>

    <div align="left">
    First Name<font color="red">*</font>:
    <?php echo form_input($firstname)?>
    <br/>

    Last Name<font color="red">*</font>:
    <?php echo form_input($lastname)?>
    <br/>

    Email Address<font color="red">*</font>:
    <?php echo form_input($email)?>
    <br/>

    Date Of Birth:
    <?php echo form_input($dateofbirth)?>
    <br/>

    Gender:
        <?php 
        echo form_radio($gender, 'Male');
        echo "Male";
        echo form_radio($gender, 'Female'); 
        echo "Female";
        ?>
        <br/>



    <strong>Account Information:</strong><br/>


    Username<font color="red">*</font>:
    <?php echo form_input($username)?><br/>

    Password<font color="red">*</font>:
    <?php echo form_password($password)?><br/>

    Password Confirmation<font color="red">*</font>:
    <?php echo form_password($confpass)?><br/>

    <?php 
    echo validation_errors();?>
    <?php echo form_submit(array('name'=>'register'), 'Register');?>
    <?php echo form_reset(array('name'=>'reset'), 'Reset')?>

</div>

</body>

This is my user.php. I’m not really sure with the codes. these are mostly form tutorials i’ve seen..

 class User extends CI_Controller {
private $view_data = array();
function _construct()
{
parent::_construct();
$this->view_data['base_url']=base_url();
}

function index()
{
$this->register();
}

function register()
{
$this->load->library('form_validation');

$this->form_validation->set_rules('firstname', 'First Name', 'trim|required|max_length[100]|min_length[1]|xss_clean');
$this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|max_length[100]|min_length[1]|xss_clean');
$this->form_validation->set_rules('email', 'Email Address', 'trim|required|max_length[100]|xss_clean|valid_email');
$this->form_validation->set_rules('dateofbirth', 'Date of Birth', 'trim|max_length[100]|min_length[1]|xss_clean');
$this->form_validation->set_rules('gender', 'Gender', 'trim|max_length[6]|min_length[6]|xss_clean');
$this->form_validation->set_rules('username', 'User Name', 'trim|required|alpha_numeric|callback_username_not_exists|max_length[100]|min_length[6]|xss_clean'); 


if ($this->form_validation->run() == FALSE)
{
//not run
$this->load->view('view_register', $this->view_data);

}
else
{
//good
$firstname=$this->input->post('firstname'); 
$lastname=$this->input->post('lastname');
$email=$this->input->post('email');
$dateofbirth=$this->input->post('dateofbirth');
$gender=$this->input->post('gender');
$username=$this->input->post('username');
$password=$this->input->post('password');

$this->User_model->register_user($firstname, $lastname, $email, $dateofbirth, $gender, $username, $password);
}
$this->load->view('view_register', $this->view_data);
}

Then after that I am stuck. After clicking Register, It says Page404 Not Found, there’s not even a validation.

  • 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-14T04:24:52+00:00Added an answer on June 14, 2026 at 4:24 am

    First. Find new tutorials, there is a lot of code in there that makes zero sense. I strongly suggest this series: http://net.tutsplus.com/sessions/codeigniter-from-scratch/

    Next. You’re getting a page not found because your form action leads no where. In the line:

    echo form_open('start');
    

    You’re trying to call a function in your controller called ‘start’ yet there is no function in your controller called start. The function is called register.

    Next. You’re running the form validation before even seeing if there is any post data and you’re actually running it before there CAN be any post data.

    You’re getting the form twice probably because you’re loading the same view into the page twice, once when the form validation fails, which it obviously will the first time you load then again when you’re calling your user model.

    Quite honestly the only answer here is to nuke what you’ve done, reinstall CI and follow the tutorial series I gave you above. The tutorials you’re following are giving you very bad practices and you need to just forget what they’ve taught you. Follow the Nettuts tutorial one step at a time and make sure you’re understanding what it’s telling you before moving on. Don’t just copy and paste and cross your fingers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function within a module that opens my Home Page Form: Function
Form is made from a function that prints out all rows that are awaiting
I have two separate arrays in my PHP mail form that are different sets
I am using button_to and link_to form helpers in Rails. I need to set
I have a single form and I need to duplicate it 200 times so
I have an asp.net form with bunch of sections that can be expanded/collapsed and
Here is the problem. In my php submission page, I have a form with
I have a form that users use to input information about a posting. When
I am trying to have a nested form on my users/new page, where it
I have a page with a couple of grids and a small form with

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.