Loading ...
Sorry, an error occurred while loading the content.
 

[ASK] Tutorial CI+Jquery Login

Expand Messages
  • Agung Sulistyo
    Selamat siang...nubie mau tanya ni... ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2 ,nemu tapi hanya yang Jquery login tanpa
    Message 1 of 6 , Sep 1, 2009
      Selamat siang...nubie mau tanya ni...
      ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2
      ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...

      Mohon bantuannya...
      terimakasih...

      --
      Regards,

      Agung Sulistyo


      [Non-text portions of this message have been removed]
    • Perdana Adhitama
      sama aja di PHP biasa sama CI yang ngebedain kan kalo di PHP biasa ngecek login pake halaman. kalo di CI pake function di controller coba pake jquery plugin
      Message 2 of 6 , Sep 1, 2009
        sama aja di PHP biasa sama CI yang ngebedain kan kalo di PHP biasa ngecek login pake halaman. kalo di CI pake function di controller

        coba pake jquery plugin validation
        http://bassistance.de/jquery-plugins/jquery-plugin-validation/
        disitu ada contoh buat login koq




        ________________________________
        From: Agung Sulistyo <agung.sulistyo.w@...>
        To: codeigniter-id@yahoogroups.com
        Sent: Tuesday, September 1, 2009 2:37:12 PM
        Subject: [codeigniter-id] [ASK] Tutorial CI+Jquery Login


        Selamat siang...nubie mau tanya ni...
        ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2
        ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...

        Mohon bantuannya.. .
        terimakasih. ..

        --
        Regards,

        Agung Sulistyo

        [Non-text portions of this message have been removed]







        [Non-text portions of this message have been removed]
      • Ibnoe
        mang jquerynya mau dipake sebagai apa? 2009/9/1 Agung Sulistyo ... -- Best Regards, Ibnoe www.ibnoe.web.id [Non-text portions of
        Message 3 of 6 , Sep 1, 2009
          mang jquerynya mau dipake sebagai apa?

          2009/9/1 Agung Sulistyo <agung.sulistyo.w@...>

          >
          >
          > Selamat siang...nubie mau tanya ni...
          > ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2
          > ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...
          >
          > Mohon bantuannya...
          > terimakasih...
          >
          > --
          > Regards,
          >
          > Agung Sulistyo
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >



          --
          Best Regards,

          Ibnoe
          www.ibnoe.web.id


          [Non-text portions of this message have been removed]
        • Agung Sulistyo
          JQuerynya buat load formnya Om... Saya sudah coba mbuat tapi ketika formnya sudah diload oleh JQuerynya, dia gak nge-redirect ke halaman utama, padahal saya
          Message 4 of 6 , Sep 1, 2009
            JQuerynya buat load formnya Om...
            Saya sudah coba mbuat tapi ketika formnya sudah diload oleh JQuerynya, dia
            gak nge-redirect ke halaman utama, padahal saya sudah menyisipkan script
            redirect ('controller2')...jadi harus direfresh dulu baru masuk ke halaman
            utama...
            Mohon bantuannya...

            2009/9/1 Ibnoe <xibnoe@...>

            >
            >
            > mang jquerynya mau dipake sebagai apa?
            >
            > 2009/9/1 Agung Sulistyo <agung.sulistyo.w@...<agung.sulistyo.w%40gmail.com>
            > >
            >
            > >
            > >
            > > Selamat siang...nubie mau tanya ni...
            > > ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2
            > > ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...
            > >
            > > Mohon bantuannya...
            > > terimakasih...
            > >
            > > --
            > > Regards,
            > >
            > > Agung Sulistyo
            > >
            > > [Non-text portions of this message have been removed]
            > >
            > >
            > >
            >
            > --
            > Best Regards,
            >
            > Ibnoe
            > www.ibnoe.web.id
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >



            --
            Regards,

            Agung Sulistyo


            [Non-text portions of this message have been removed]
          • Agung Sulistyo
            Thanks Om Perdana... Saya pakai seperti yang dicontohkan itu... Muncul masalah baru...yaitu ketika button submit diklik, proses akan meredirect ke controller
            Message 5 of 6 , Sep 1, 2009
              Thanks Om Perdana...
              Saya pakai seperti yang dicontohkan itu...
              Muncul masalah baru...yaitu ketika button submit diklik, proses akan
              meredirect ke controller selanjutnya, tapi form login masih diload juga.
              Apabila browser direfresh baru akan normal...
              Berikut script controller yang menjalankan fungsi loginnya :
              controller : login.php
              <?php
              Class Login Extends Controller
              {
              function Login()
              {
              parent::controller();
              $this->load->helper('url');
              $this->load->library(array('encrypt', 'session'));
              if ($this->session->userdata('skolab_logged_in') == TRUE)
              redirect('skolab'); // jika session masih terdaftar, otomatis redirect ke
              controller skolab
              }

              function index()
              {
              $this->load->view('index');
              }

              function proses_login()
              {
              $username = trim(mysql_real_escape_string($this->input->post('username')));
              $password = trim(mysql_real_escape_string($this->input->post('password')));

              if((!empty($username)) && (!empty($password)))
              {
              $query_login = $this->db->get_where('user', array('user_name'=>$username),
              1, 0);
              $row = $query_login->row();

              // cek username
              if($query_login->num_rows() == 0)
              {
              echo "Username Anda Salah!";
              }
              else
              {
              // cek password
              if($password == $this->encrypt->decode($row->user_password))
              {
              // user has been logged in
              $this->session->set_userdata('skolab_id_user',$row->user_id);
              $this->session->set_userdata('skolab_username',$row->user_name);
              $this->session->set_userdata('skolab_logged_in', TRUE);

              redirect('skolab');
              }
              else
              {
              echo "Password Anda Salah!";
              }
              }
              }
              }
              }
              ?>

              controller skolab isinya hanya seperti ini :
              <?php

              class Skolab extends Controller {

              function Skolab()
              {
              parent::Controller();
              }

              function index()
              {
              $data['title'] = "Sistem Kolaborasi Analysis - User Dashboard";
              $this->load->view('header');
              $this->load->view('home',$data);
              $this->load->view('footer');
              }

              }
              ?>

              Kira-kira dimana ya salahnya?? mohon bantuannya...

              2009/9/1 Perdana Adhitama <perdana_adhitama@...>

              >
              >
              > sama aja di PHP biasa sama CI yang ngebedain kan kalo di PHP biasa ngecek
              > login pake halaman. kalo di CI pake function di controller
              >
              > coba pake jquery plugin validation
              > http://bassistance.de/jquery-plugins/jquery-plugin-validation/
              > disitu ada contoh buat login koq
              >
              > ________________________________
              > From: Agung Sulistyo <agung.sulistyo.w@...<agung.sulistyo.w%40gmail.com>
              > >
              > To: codeigniter-id@yahoogroups.com <codeigniter-id%40yahoogroups.com>
              > Sent: Tuesday, September 1, 2009 2:37:12 PM
              > Subject: [codeigniter-id] [ASK] Tutorial CI+Jquery Login
              >
              > Selamat siang...nubie mau tanya ni...
              > ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2
              > ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...
              >
              > Mohon bantuannya.. .
              > terimakasih. ..
              >
              > --
              > Regards,
              >
              > Agung Sulistyo
              >
              > [Non-text portions of this message have been removed]
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >



              --
              Regards,

              Agung Sulistyo


              [Non-text portions of this message have been removed]
            • Taufik Ramdani
              coba bantu deh, mudah2n ngebantu buat login form biasa pada view yg kamu mau. ini login form yg sy buat, kamu bisa kreasikan sendiri sesuai kemauan kamu. lalu
              Message 6 of 6 , Sep 2, 2009
                coba bantu deh, mudah2n ngebantu
                buat login form biasa pada view yg kamu mau. ini login form yg sy buat, kamu bisa kreasikan sendiri sesuai kemauan kamu. lalu ubah url pada js file nya sesuai dengan controler yang mau kamu gunakan sebagai login nya

                ---view--
                <form name="contact" method="post" action="">
                     <p>
                       <label for="username" id="username_label">User Name</label>
                        <input type="text" name="username" id="username" size="30" value="<?php echo set_value('username'); ?>" class="box" />
                           <label for="username" class="error style1" id="username_error">This field is required.</label><br />
                                         
                           <label for="password" id="pass_label">Password</label>
                            <input type="text" name="password" id="password" size="30" value="<?php echo set_value('password'); ?>" class="box" />
                              <label for="password" class="error style1" id="password_error">This field is required.</label>
                              <input type="submit" name="submit" class="btn" id="submit_btn" value="Send" />      
                </form>

                ----js file-----

                $(function() {
                  $('.error').hide();
                  $('input.text-input').css({backgroundColor:"#FFFFFF"});
                  $('input.text-input').focus(function(){
                    $(this).css({backgroundColor:"#FFDDAA"});
                  });
                  $('input.text-input').blur(function(){
                    $(this).css({backgroundColor:"#FFFFFF"});
                  });

                  $(".btn").click(function() {
                        // validate and process form
                        // first hide any error messages
                    $('.error').hide();
                       
                      var name = $("input#username").val();
                        if (name == "") {
                      $("label#username_error").show();
                      $("input#username").focus();
                      return false;
                    }
                        var email = $("input#password").val();
                        if (email == "") {
                      $("label#password_error").show();
                      $("input#password").focus();
                      return false;
                    }

                       
                        //var dataString = 'name='+ name + '&email=' + email ;
                        var dataString = 'username='+$("#username").val()+'&password='+$("#password").val();
                        //alert (dataString);return false;
                       
                        $.ajax({
                      type: "POST",
                      url: "http://www/login",
                      dataType: "json",
                      data: dataString,
                      //data: dataString,
                      success: updateLogin
                     });
                    return false;
                    });
                });

                updateLogin(function(data)) {
                    var base_url = '<?php echo base_url()?>';
                    if (data.success == 'yes') {
                   window.location='controler yang akan di redirect ';
                }

                runOnLoad(function(){
                  $("input#name").select().focus();
                });


                -----controler login-----
                class login extends Controller {

                    function login(){ }
                   
                    function index(){
                           
                           if($this->mdl_users->auth($username, $password)){
                                $output = '{ "success": "yes", "welcome": "Welcome Back" }';
                                $this->session->set_userdata('username', $username);
                            }else{
                                $output = '{ "success": "no", "message": "username and password not valid" }';
                            }
                          
                        echo $output;
                       
                    }

                regards,

                aleks pelaut
                --newbie--



                --- On Wed, 2/9/09, Agung Sulistyo <agung.sulistyo.w@...> wrote:

                From: Agung Sulistyo <agung.sulistyo.w@...>
                Subject: Re: [codeigniter-id] [ASK] Tutorial CI+Jquery Login
                To: codeigniter-id@yahoogroups.com
                Date: Wednesday, 2 September, 2009, 11:05 AM






                 





                Thanks Om Perdana...

                Saya pakai seperti yang dicontohkan itu...

                Muncul masalah baru...yaitu ketika button submit diklik, proses akan

                meredirect ke controller selanjutnya, tapi form login masih diload juga.

                Apabila browser direfresh baru akan normal...

                Berikut script controller yang menjalankan fungsi loginnya :

                controller : login.php

                <?php

                Class Login Extends Controller

                {

                function Login()

                {

                parent::controller( );

                $this->load- >helper(' url');

                $this->load- >library( array('encrypt' , 'session'));

                if ($this->session- >userdata( 'skolab_logged_ in') == TRUE)

                redirect('skolab' ); // jika session masih terdaftar, otomatis redirect ke

                controller skolab

                }



                function index()

                {

                $this->load- >view('index' );

                }



                function proses_login( )

                {

                $username = trim(mysql_real_ escape_string( $this->input- >post('username' )));

                $password = trim(mysql_real_ escape_string( $this->input- >post('password' )));



                if((!empty($ username) ) && (!empty($password) ))

                {

                $query_login = $this->db->get_ where('user' , array('user_ name'=>$username ),

                1, 0);

                $row = $query_login- >row();



                // cek username

                if($query_login- >num_rows( ) == 0)

                {

                echo "Username Anda Salah!";

                }

                else

                {

                // cek password

                if($password == $this->encrypt- >decode($ row->user_ password) )

                {

                // user has been logged in

                $this->session- >set_userdata( 'skolab_id_ user',$row- >user_id) ;

                $this->session- >set_userdata( 'skolab_username ',$row->user_ name);

                $this->session- >set_userdata( 'skolab_logged_ in', TRUE);



                redirect('skolab' );

                }

                else

                {

                echo "Password Anda Salah!";

                }

                }

                }

                }

                }

                ?>



                controller skolab isinya hanya seperti ini :

                <?php



                class Skolab extends Controller {



                function Skolab()

                {

                parent::Controller( );

                }



                function index()

                {

                $data['title' ] = "Sistem Kolaborasi Analysis - User Dashboard";

                $this->load- >view('header' );

                $this->load- >view('home' ,$data);

                $this->load- >view('footer' );

                }



                }

                ?>



                Kira-kira dimana ya salahnya?? mohon bantuannya.. .



                2009/9/1 Perdana Adhitama <perdana_adhitama@ yahoo.com>



                >

                >

                > sama aja di PHP biasa sama CI yang ngebedain kan kalo di PHP biasa ngecek

                > login pake halaman. kalo di CI pake function di controller

                >

                > coba pake jquery plugin validation

                > http://bassistance. de/jquery- plugins/jquery- plugin-validatio n/

                > disitu ada contoh buat login koq

                >

                > ____________ _________ _________ __

                > From: Agung Sulistyo <agung.sulistyo. w@...<agung.sulistyo. w%40gmail. com>

                > >

                > To: codeigniter- id@yahoogroups. com <codeigniter- id%40yahoogroups .com>

                > Sent: Tuesday, September 1, 2009 2:37:12 PM

                > Subject: [codeigniter- id] [ASK] Tutorial CI+Jquery Login

                >

                > Selamat siang...nubie mau tanya ni...

                > ada yang punya link tutorial/source code CI+Jquery Login???sy udah cari2

                > ,nemu tapi hanya yang Jquery login tanpa implementasi di CI...

                >

                > Mohon bantuannya.. .

                > terimakasih. ..

                >

                > --

                > Regards,

                >

                > Agung Sulistyo

                >

                > [Non-text portions of this message have been removed]

                >

                > [Non-text portions of this message have been removed]

                >

                >

                >



                --

                Regards,



                Agung Sulistyo



                [Non-text portions of this message have been removed]





























                New Email addresses available on Yahoo!
                Get the Email name you've always wanted on the new @ymail and @rocketmail.
                Hurry before someone else does!
                http://mail.promotions.yahoo.com/newdomains/aa/

                [Non-text portions of this message have been removed]
              Your message has been successfully submitted and would be delivered to recipients shortly.