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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:18:03+00:00 2026-06-03T00:18:03+00:00

I have a Controller called Register that looks like this: class Register extends CI_Controller

  • 0

I have a Controller called Register that looks like this:

class Register extends CI_Controller
{
    public function index()
    {
        $this->load->view('register');
    }

    public function create()
    {
        $this->load->library('form_validation');
        //set rules here

        if ($this->form_validation->run() == TRUE)
        {
            //everything checks out
        }
        else
        {
            $this->load->view('register');
        }
    }
}

The view contains a form that posts to register/create.

My problem is, when I go to localhost/register and fill out the form incorrectly, the form reloads, but the url is now:

localhost/register/register/create

If I enter it incorrectly again

localhost/register/register/register/create

and so on…

I’m guess this is an htaccess and I’ve tried using some standard CodeIgniter htaccess files available online, but none fix this issue. I’m using this on a WAMP server.

EDIT

The view file only consists of the form, for now. I prefer using direct HTML instead of the CodeIgniter Form helper.

<form id="register_form" method="post" action="register/create" title="Create an Account">
    <!-- input fields -->
</form>
  • 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-03T00:18:04+00:00Added an answer on June 3, 2026 at 12:18 am

    Use full url. Either current_url() or site_url('register') in your form’s action.

    It’s good practice you use either of these or preffix with base_url() since that allows your site to run without having to be the domain path.
    For instance you can, if needed run the site on example.com/my_site/ instead of only being able to run on example.com.

    For fullest possible control of your form’s action, always start on http:// and avoid relative urls (action=”register” for instance).

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

Sidebar

Related Questions

I have a model called Action. It looks like this: class Action < ActiveRecord::Base
I have a controller called 'admin' class Admin extends CI_Controller { and under the
I have a simple controller called list_controller with an index that basically does def
I have a controller called MetricsController with a single action method: public class MetricsController
This issue is very likely codeigniter specific. I have a controller called redirect.php that
I have a controller that is called with AJAX (sends JSON data), so I
I have a controller which has a method called history class UsersController < ApplicationController
So I have a controller called Music with one action which is index. On
I have a controller called AuctionsController. In it I have Actions called Index() and
I have a controller called HomeController with the actions Index(), MethodOne() and MethodTwo(). Each

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.