Welcome Guest, Not a member yet? Register   Sign In
Two form on Same Page
#8

[eluser]Yash[/eluser]
Controller Code

Code:
function do_search()
    {
        
        
        $rules['blog_search'] = "required";
        $this->validation->set_rules($rules);

        $fields['blog_search'] = "Search";
        $this->validation->set_fields($fields);
        
        if ($this->validation->run())
        {        
            $keyword=$this->input->post('blog_search');
            $place=$this->input->post('search_area');
            
            
            //redirect(,'refresh',,1);
            
            $data['title']="Information Page";
            $data['header']="Information";
            $data['url']='/blog/search/'.$place.'/'.$keyword;
            $data['time']="2";
            $data['message']="<p>Thank You!</p>
                              <p>Stand by while we direct you to your search results</p>
                              <p>".anchor('/blog/search/'.$place.'/'.$keyword,"Click here")."if you are not redirected automatically</p>";
            $this->load->view('info',$data);
            
            
        }
        else
        {
        $data['title']="MyBlog";
        $data['allposts']="ss";//$this->load->view('searchform',$data,TRUE);
        $data['SearchForm']=$this->load->view('searchform',$data,TRUE);
        $data['pages']=$this->Homemodel->PageLinks();
        $data['Categories']=$this->Categoriesmodel->CreateSimpleLiCategories();
        $data['TagClouds']=$this->Homemodel->TagClouds();
        $data['RecentPosts']=$this->Homemodel->RecentPosts(10);
        $data['RecentComments']=$this->Commentsmodel->RecentComments(10);
        $data['Archives']=$this->Homemodel->ArchivesList();    
        
        $this->load->view('main',$data);
          
        }
        }



function ForgetPassword()
    {
        $data['title']="Forget Password";
        $this->load->library('validation');
        $this->load->helper('security');
        $this->load->library('table');
        
                
        $rules['username'] = "trim|min_length[4]|max_length[20]";
        $rules['email'] = "trim|required|valid_email|max_length[100]";
        $this->validation->set_rules($rules);

        $fields['username'] = 'Username';
        $fields['email'] = 'Email ID';
        $this->validation->set_fields($fields);
        
        if ($this->validation->run())
        {
                //all details are ok.Now save these.
                //$this->load->model('Usersmodel','',TRUE);
                $this->Usersmodel->ForgetPassword();
                
        }
        else
        {
                  //load it first till user fill all details correctly.
                  
                $data['title']="MyBlog";
                $data['allposts']=$this->load->view('users/forgetpassword',$data,TRUE);
                $data['pages']=$this->Homemodel->PageLinks();
                $data['Categories']=$this->Categoriesmodel->CreateSimpleLiCategories();
                $data['TagClouds']=$this->Homemodel->TagClouds();
                $data['RecentPosts']=$this->Homemodel->RecentPosts(10);
                $data['RecentComments']=$this->Commentsmodel->RecentComments(10);
                $data['Archives']=$this->Homemodel->ArchivesList();    
                
                $this->load->view('main',$data);
                  
        }
    }


Messages In This Thread
Two form on Same Page - by El Forum - 07-31-2008, 03:43 AM
Two form on Same Page - by El Forum - 07-31-2008, 03:50 AM
Two form on Same Page - by El Forum - 07-31-2008, 03:57 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:30 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:37 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:38 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:40 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:45 AM
Two form on Same Page - by El Forum - 07-31-2008, 04:45 AM
Two form on Same Page - by El Forum - 07-31-2008, 05:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB