Welcome Guest, Not a member yet? Register   Sign In
problem with my code for requested url
#1

[eluser]alamin_cse07[/eluser]
here is my controller code and view code .but when i click on register the error"Object not found!The requested URL was not found on this server." please help me about this.
Code:
<?php
class User extends CI_Controller {


    function __construct() {
        parent::__construct();
       $this->view_data['base_url']=base_url();
}
  function index()
{
     $this->register();
  
  }

function register()
{


   $this->load->view('view_register',$this->view_data);
  
  
  
}
}
?>
view code:
Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
form li{
list-style:none;
}
</style>
</head>

<body>


<p> User Registration Form </p>
&lt;?php
echo form_open($base_url . 'user/register');


$username=array(
   'name' =>'reg_username',
   'id' => 'reg_id',
   'value'  =>''
);

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

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

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

$password2=array(
   'name' =>'password2',
   'id' => 'password2',
   'value'  =>''
);
?&gt;


<ul>
<li>
<label>Username</label>
  <div>
&lt;?php echo form_input($username);?&gt;
</div>
</li>


<li>
<label>Name</label>
  <div>
&lt;?php echo form_input($name);?&gt;
</div>
</li>
<li>
<label>Email</label>
  <div>
&lt;?php echo form_input($email);?&gt;
</div>
</li>
<li>
<label>Password</label>
  <div>
&lt;?php echo form_password($password);?&gt;
</div>
</li>
<li>
<label>Conform Password</label>
  <div>
&lt;?php echo form_password($password2);?&gt;
</div>
</li>
<li>&lt;?php echo validation_errors()?&gt;
</li>
<li>

<div>
&lt;?php echo form_submit(array('name'=>'register'),'Register');?&gt;
</div>
</li>
</ul>


&lt;?php
echo form_close();

?&gt;
&lt;/body&gt;
&lt;/html&gt;
#2

[eluser]InsiteFX[/eluser]
Code:
&lt;?php
class User extends CI_Controller {

    public $view_data = array();

    function __construct() {
        parent::__construct();
       $this->view_data['base_url'] = base_url();
}
  function index()
{
     $this->register();
}

function register()
{
   $this->load->view('view_register', $this->view_data);
}
}
?&gt;
#3

[eluser]alamin_cse07[/eluser]
Thanks for replay.Still now the same problem.What can i do?
#4

[eluser]InsiteFX[/eluser]
Use echo var_dump($this->view_data);

To see if you are getting data into the array...
#5

[eluser]alamin_cse07[/eluser]
i don't understand were to correct my code.it's just a video tutorials registration form code.




Theme © iAndrew 2016 - Forum software by © MyBB