Put a query in text boxes

0

I'm doing a window to edit data in phpmyadmin and I want to put the information in text boxes, but I have not found a way to insert it without being a placeholder. And what I need is for it to look as if the user had inserted it.

<div class="control-group">
<label class="control-label" for="rfc">RFC</label>
<div class="controls">
<input type="text" name="rfc" id="rfc" placeholder="RFC del cliente" class="form-control span8 tip" required>
                                            </div>
                                        </div>

      <div class="control-group">
        <label class="control-label" for="email">Email</label>
                       <div class="controls">
                 <input name="email" id="email" class="form-control span8 tip" type="email" placeholder="Correo electrónico"  required />
                      </div>
             </div>

                                         <div class="control-group">
         <label class="control-label mr-4 espacioss" for="direccion">ADMIN</label>
                                 <div class="input-group mb-3">
                                      <div class="input-group-prepend">
                                      </div>
                         <select class="custom-select" id="ad" name="ad">
   <option selected value="1">Admin</option>
   <option value="2">Encargado</option                                
   <option value="3">Cajero</option>
   <option value="4">Recepcion</option>
                                                      </select>
                                                    </div>
                                        </div>
    
asked by GERMAN SOSA 12.04.2018 в 02:44
source

1 answer

3

You can do that by value , example:

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
  First name: <input type="text" name="fname" value="John"><br>
  Last name: <input type="text" name="lname" value="Doe"><br>
  <input type="submit" value="Submit form">
</form>

</body>
</html>

If you execute that little html time what is within value is what is shown within the input .

If you want to print something inside the value with PHP it is enough to do the following:

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php">
  First name: <input type="text" name="fname" value="<?php echo $dato1; ?>"><br>
  Last name: <input type="text" name="lname" value="<?php echo $dato2; ?>"><br>
  <input type="submit" value="Submit form">
</form>

</body>
</html>
    
answered by 12.04.2018 в 03:16