[eluser]ranjudsokomora[/eluser]
rmw603,
You will need a controller, that may look like this:
Code:
class Welcome extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->library('form_validation');
$this->load->helper('url');
$this->load->helper('form');
}
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://ellislab.com/codeigniter/user-guide/general/urls.html
*/
public function index()
{
//$this->load->view('welcome_message');
$this->form_validation->set_rules('field0','URL','required');
IF ($this->form_validation->run()===FALSE) {
$this->load->view("form");
}
ELSE {
redirect($this->input->post('field0'));
exit;
}
}
}
/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
and your view may look like this:
Code:
<html>
<head>
<title>Form Title</title>
</head>
<body>
<?PHP
echo form_open('welcome/index');
?>
<h1>URL:</h1><br />
<?PHP
echo form_input('field0','http://www.google.com');
?>
<br />
<?PHP
echo form_submit('submit','Go To Site!');
echo form_close();
?>