0

So, whenever I load register page, on the input field, the username and password field get autofilled with my phpmyadmin id and password (which is root and 1234)

The picture of it

So, here is the Controller user.php

 <?php
class User extends CI_Controller {
  public function register() {
    // load View
    $data['main_content'] = 'register';
    $this->load->view('layouts/main', $data);
  }
}
 ?> 

Here is the main.php in folder views/layouts

 <?php $data['main_content'] = $main_content; ?>
<?php $this->load->view('layouts/includes/header', $data); ?>
    <!-- Display Main Content -->
    <?php $this->load->view($main_content); ?>
<?php $this->load->view('layouts/includes/footer'); ?> 

And here is the Views register.php

<div class="container-fluid category-home-text">
   <h3 class="text-center text-uppercase">Register</h3>
 </div>
 <div class="container-fluid login-container">
   <form id="form1" name="form1" method="post">
     <div class="register-block">
     <div class="form-group">
      <label>Name*</label>
      <input type="text" class="form-control" name="fullname" placeholder="Enter Your Full Name">
     </div>
     <div class="form-group">
      <label>Email Address*</label>
      <input type="email" class="form-control" name="email" placeholder="Enter Your Email Address">
     </div>
     <div class="form-group">
      <label>Chose Username*</label>
      <input type="text" class="form-control" name="username" placeholder="Create A Username">
     </div>
     <div class="form-group">
      <label>Password*</label>
      <input type="password" class="form-control" name="password" placeholder="Enter A Password">
     </div>
       <div class="form-group">
      <label>Confirm Password*</label>
      <input type="password" class="form-control" name="cpassword" placeholder="Enter Password Again">
     </div>
       <button type="submit" class="btn btn-primary btn-block">Register</button>
      </div>
    </form>
 </div>  

I dont understand because I don't set a value on the view at all.

phapha pha
  • 319
  • 1
  • 5
  • 16
  • 1
    This has nothing to do with your view, this is simply the browser’s password manager at work … – CBroe Aug 28 '17 at 11:15
  • It's the browser's behaviour. Credentials are saved by domain. So when you logged to phpmyadmin, you told your browser to remember it. So now when it detects a login form, it autofills it. – Salketer Aug 28 '17 at 11:16
  • And, please change your database credentials.. using root/root is not a good idea. :) – Salketer Aug 28 '17 at 11:17
  • So what is the solution then? my id password is root 1234 – phapha pha Aug 28 '17 at 11:20
  • 3
    Either don't tell your browser to remember your password, or you could disable autocomplete i think? https://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field-input-tag – Salketer Aug 28 '17 at 11:22
  • _“So what is the solution then?”_ - to what actual _problem_? You not knowing how your browser’s password manager works? Go read up on that then ... – CBroe Aug 28 '17 at 11:23
  • Alright, then. Thank you though, It works well on Chrome. – phapha pha Aug 28 '17 at 11:24

1 Answers1

0

Well, it´s really a behavior of many browsers.

What you can do is clean your browser cookies and a thing that would be cool using is this html5 code at your inputs, but it´s useless in preventing anyone to save the password on browser again. It´s just to don´t give "clues" of your login.

(autocomplete="off")

<input type="text" autocomplete="off" class="form-control" name="fullname" placeholder="Enter Your Full Name">
Luiz
  • 129
  • 9