Scroll to top

Haloo! Selamat Datang di Komunitas Private Training Web Development (32381 Members, 276 Projects, 2821 Topic, 7824 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time) untuk mengerjakan project/aplikasi anda?, cari disini : Members Area Jobs!
Tidak Ada Notifikasi Salah Input captcha di Swarakalibata Ci
Ujang Rukman Mengatakan : Members -
  1. Assalamualaikum Warahmatullahi Wabarakatuh... mas saya coba inputkan captcha salah pada form kontributor tapi tidak ada notif error, namun memang untuk data tetap tidak masuk database, dan ketika salah input captcha langsung redirect ke home tidak ada notif error, bagaimana cara mengatasi nya
Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Mohon bantuannya mas

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Ketika salah input captcha ga ada notif dulu tapi langsung redirext ke home, apakah tidak ada script pengecekan captcha nya?

Mahmud Al Fauzi Mengatakan :
Members -
  1. Assalam,.. iya gan termasuk tidak notif khusus jika username / nickname sama... sedangkan field nickname itu jadi primary.... :) :)

Bukhari al Muslim Mengatakan :
Admin -
  1. Assalam,.. pada sikolag ci tidak ada modul kontributor mas
  2. mungkin maksudnya pada swarakalibata ci?
  3.  
  4. cara untuk menambahkan notifikasi bisa dengan js :
  5. cukup dengan begini saja, buka file "application/controllers/kontributor.php" pada baris 66 cari script berikut :
  6. }
  7. redirect('administrator/home');
  8.  
  9. ubah menjadi :
  10. redirect('administrator/home');
  11. }else{
  12. echo "<script>window.alert('Maaf, Anda Tidak Memiliki akses');
  13. window.location=('".base_url()."kontributor')</script>";
  14. }
  15.  
  16. simpan dan selesai.

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Kenapa ga berfungsi mas validasinya ya, saya udh coba pasang

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Penempatan nya redirect ke home dulu atau echo alart dulu mas

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Alhamdulillah bisa mas, terima kasih

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. Kalau misalkan redirect nya di ganti gimana mas jadi ketika di eksekusi dan captcha salah tidak redirect ke halaman, tapi focus ke inputan captcha, soalnya kalau redirect itu kan jadi ke reload dan harus isi data dari awal

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. maaf mas pada fom kontributor Swarakalibata ketika input username yg sama malah error saya sudah coba pake cara ini
  2. https://members.phpmu.com/forum/read/notif-menginputkan-data-yang-sama namun masih gagal, kira-kira penempatan nya untuk di Swarakalibata pa form kontributor bagaimana

Mahmud Al Fauzi Mengatakan :
Members -
  1. Assalam,.. Mas "Ujang Rukman" mohon rubah telebih dahulu judul pertanyaan Forumnya ke "Tidak Ada Notifikasi Salah Input captcha di Swarakalibata CI" (Bukan SIKOLAG.
  2.  
  3. Selanjutnya : Mas "Bukhori Al Muslim" : Notif / Alert berhasil muncul. Namun, Image / Gambar berhasil terupload. (Khawatir hal ini akan membebani Server). Mohon solusinya. :)

Mahmud Al Fauzi Mengatakan :
Members -
  1. Assalam,.. Selanjutnya : Mas "Bukhari Al Muslim" : Notif / Alert berhasil muncul. Namun, Image / Gambar berhasil terupload. (Khawatir hal ini akan membebani Server). Mohon solusinya. :)

Ujang Rukman Mengatakan :
Members -
  1. Assalam,.. saya aman mas, kalau error tidak masuk semua nya

Mahmud Al Fauzi Mengatakan :
Members -
  1. Assalam,.. coba bagi script mas

Ujang Rukman Mengatakan :
Members -
  1. Assalam,..
  2. ini mas
  3. <?php
  4. defined('BASEPATH') OR exit('No direct script access allowed');
  5. class Kontributor extends CI_Controller {
  6. public function index(){
  7. $data['title'] = "Pendaftaran Kontributor";
  8. $data['description'] = description();
  9. $data['keywords'] = keywords();
  10.  
  11. $this->load->helper('captcha');
  12. $vals = array(
  13. 'img_path' => './captcha/',
  14. 'img_url' => base_url().'captcha/',
  15. 'font_path' => './asset/Tahoma.ttf',
  16. 'font_size' => 15,
  17. 'img_width' => '150',
  18. 'img_height' => 40,
  19. 'border' => 0,
  20. 'word_length' => 5,
  21. 'expiration' => 7200
  22. );
  23.  
  24. $cap = create_captcha($vals);
  25. $data['image'] = $cap['image'];
  26. $this->session->set_userdata('mycaptcha', $cap['word']);
  27. $this->template->load(template().'/template',template().'/kontributor',$data);
  28. }
  29.  
  30. function pendaftaran(){
  31. if (isset($_POST['submit'])){
  32. $cek = $this->model_app->view_where('users',array('username'=>cetak($this->input->post('a'))));
  33. if ($cek->num_rows()>0){
  34. echo $this->session->set_flashdata('message', '<div class="alert alert-danger">Maaf, Username '.cetak($this->input->post('a')).' sudah digunakan !</div>');
  35. redirect('kontributor');
  36. }else{
  37. $config['upload_path'] = 'asset/foto_user/';
  38. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
  39. $config['max_size'] = '1000'; // kb
  40. $this->load->library('upload', $config);
  41. $this->upload->do_upload('f');
  42. $hasil=$this->upload->data();
  43. if ($this->input->post() && (strtolower($this->input->post('secutity_code')) == strtolower($this->session->userdata('mycaptcha')))) {
  44. if ($hasil['file_name']==''){
  45. $data = array('username'=>cetak($this->input->post('a')),
  46. 'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
  47. 'nama_lengkap'=>cetak($this->input->post('c')),
  48. 'email'=>cetak($this->input->post('d')),
  49. 'no_telp'=>cetak($this->input->post('e')),
  50. 'level'=>'kontributor',
  51. 'blokir'=>'N',
  52. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  53. }else{
  54. $data = array('username'=>cetak($this->input->post('a')),
  55. 'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
  56. 'nama_lengkap'=>cetak($this->input->post('c')),
  57. 'email'=>cetak($this->input->post('d')),
  58. 'no_telp'=>cetak($this->input->post('e')),
  59. 'foto'=>$hasil['file_name'],
  60. 'level'=>'kontributor',
  61. 'blokir'=>'N',
  62. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  63. }
  64.  
  65. $this->model_app->insert('users',$data);
  66. $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
  67. 'id_modul'=>18);
  68. $this->model_app->insert('users_modul',$datam);
  69. $this->session->set_userdata('upload_image_file_manager',true);
  70. $this->session->set_userdata(array('username'=>cetak($this->input->post('a')),
  71. 'level'=>'kontributor',
  72. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis')));
  73. redirect('administrator/home');
  74.  
  75. }else{
  76. echo $this->session->set_flashdata('captcha', '<div class="alert alert-danger"> Captcha tidak sesuai !</div>');
  77. redirect('kontributor');
  78. }
  79. }}
  80. }
  81. }
  82.  

Mahmud Al Fauzi Mengatakan :
Members -
  1. Assalam,.. ke /asset/foto_user photonya masuk... sudah saya coba pake full script diatas

Ujang Rukman Mengatakan :
Members -
  1. Assalam,..
  2. coba ini mas
  3. <?php
  4. defined('BASEPATH') OR exit('No direct script access allowed');
  5. class Kontributor extends CI_Controller {
  6. public function index(){
  7. $data['title'] = "Pendaftaran Kontributor";
  8. $data['description'] = description();
  9. $data['keywords'] = keywords();
  10.  
  11. $this->load->helper('captcha');
  12. $vals = array(
  13. 'img_path' => './captcha/',
  14. 'img_url' => base_url().'captcha/',
  15. 'font_path' => './asset/Tahoma.ttf',
  16. 'font_size' => 15,
  17. 'img_width' => '150',
  18. 'img_height' => 40,
  19. 'border' => 0,
  20. 'word_length' => 5,
  21. 'expiration' => 7200
  22. );
  23.  
  24. $cap = create_captcha($vals);
  25. $data['image'] = $cap['image'];
  26. $this->session->set_userdata('mycaptcha', $cap['word']);
  27. $this->template->load(template().'/template',template().'/kontributor',$data);
  28. }
  29.  
  30. function pendaftaran(){
  31. if (isset($_POST['submit'])){
  32. if ($this->input->post() && (strtolower($this->input->post('secutity_code')) == strtolower($this->session->userdata('mycaptcha')))) {
  33. $cek = $this->model_app->view_where('users',array('username'=>cetak($this->input->post('a'))));
  34. if ($cek->num_rows()>0){
  35. echo $this->session->set_flashdata('message', '<div class="alert alert-danger">Maaf, Username '.cetak($this->input->post('a')).' sudah digunakan !</div>');
  36. redirect('kontributor');
  37. }else{
  38. $config['upload_path'] = 'asset/foto_user/';
  39. $config['allowed_types'] = 'gif|jpg|png|JPG|JPEG';
  40. $config['max_size'] = '1000'; // kb
  41. $this->load->library('upload', $config);
  42. $this->upload->do_upload('f');
  43. $hasil=$this->upload->data();
  44. if ($hasil['file_name']==''){
  45. $data = array('username'=>cetak($this->input->post('a')),
  46. 'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
  47. 'nama_lengkap'=>cetak($this->input->post('c')),
  48. 'email'=>cetak($this->input->post('d')),
  49. 'no_telp'=>cetak($this->input->post('e')),
  50. 'level'=>'kontributor',
  51. 'blokir'=>'N',
  52. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  53. }else{
  54. $data = array('username'=>cetak($this->input->post('a')),
  55. 'password'=>hash("sha512", md5(cetak($this->input->post('b')))),
  56. 'nama_lengkap'=>cetak($this->input->post('c')),
  57. 'email'=>cetak($this->input->post('d')),
  58. 'no_telp'=>cetak($this->input->post('e')),
  59. 'foto'=>$hasil['file_name'],
  60. 'level'=>'kontributor',
  61. 'blokir'=>'N',
  62. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'));
  63. }
  64.  
  65. $this->model_app->insert('users',$data);
  66. $datam = array('id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis'),
  67. 'id_modul'=>18);
  68. $this->model_app->insert('users_modul',$datam);
  69. $this->session->set_userdata('upload_image_file_manager',true);
  70. $this->session->set_userdata(array('username'=>cetak($this->input->post('a')),
  71. 'level'=>'kontributor',
  72. 'id_session'=>md5(cetak($this->input->post('a'))).'-'.date('YmdHis')));
  73. redirect('administrator/home');
  74.  
  75. }
  76. }else{
  77. echo $this->session->set_flashdata('captcha', '<div class="alert alert-danger"> Captcha tidak sesuai !</div>');
  78. redirect('kontributor');
  79. }
  80. }
  81. }
  82. }
  83.  

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!