Welcome Guest, Not a member yet? Register   Sign In
Help Please
#1

[eluser]shyam1326[/eluser]
Hi all,

I am new to codeigniter, I am trying to create a validation form and when I try and run the form in the browser,I keep getting a 404 error, I have checked all config files and database config, there seems to be nothing wrong, it could be a problem with my route file, what is the normal route path?

Thank You
#2

[eluser]thisischris[/eluser]
Is your computer turned on? Are you sure? (sarcasm)

Provide some code... We can't guess...
#3

[eluser]shyam1326[/eluser]
This is the route.php coding:
$route['default_controller'] = 'welcome';
$route['404_override'] = 'errors/page_missing';
every time I run the form, the url says index.php/index.php/form and says a 404 error to check my route.php file.

This is my ci controller file:

<?php

class Form extends CI_Controller {

function index()
{
$this->load->helper(array('form','url'));

$this->load->library('form_validation');

$this->form_validation->set_rules('username', 'Username', 'required');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
$this->form_validation->set_rules('email', 'Email', 'required');

if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}
}
?>

any ideas?

Cheers
#4

[eluser]tpetrone[/eluser]

I think your misunderstand how the router/routing works in CI

So.. Try.


https://path/to/your/ci_install/index.php/Form


the "Form" is your controller..

by default your index() method will be run.









Theme © iAndrew 2016 - Forum software by © MyBB