Welcome Guest, Not a member yet? Register   Sign In
$ result does not shows in my view!!! HELP!!!

[eluser]Luis ACE[/eluser]
Here is my code, I dont have your signup_model. I excluded it in my code.

Form Controller

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Form extends CI_Controller {

    public function __construct()

    public function index()
        $data = array();

        $this->form_validation->set_rules('email', 'Email', 'required|valid_email', 'E-mail is not valid!');
        if ($this->form_validation->run() == FALSE)
            $data['result'] = validation_errors();
            $data['result'] = 'Successful.';
        $this->load->view('home', $data);

your View

<form method="post" action="form">
    <p class="space">Sign-up: &lt;input type="text" name="email" value="&lt;?php echo set_value('email'); ?&gt;" size="30" /&gt;
    &lt;input type="hidden" name="type" value="&lt;?php echo set_value('type'); ?&gt;" size="50" /&gt;
    &lt;input type="submit" class="button" value="Submit" /&gt;&lt;/p>
<span>&lt;?php if(isset($result)) echo $result; ?&gt;</span>

See if that works.

oh! Thank you very much! It works now!
All the best!

Theme © iAndrew 2016 - Forum software by © MyBB