Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $comentarios = $_POST;
- echo "<form method='post' action='#'>";
- $nr_comentarios = count($_POST)-1;
- for ($i = 0; $i < $nr_comentarios; $i++) {
- echo "<input type='text' name='$i' class='form-control' value='$comentarios[$i]'><br>";
- };
- if(isset($_POST['new'])){
- if($_POST['new'] != ''){
- echo "<input type='text' name='$nr_comentarios' class='form-control' value=".$comentarios['new']."><br>";
- }
- }
- echo "<input type='text' name='new' class='form-control'><br>";
- echo "<button type='submit' class='btn btn-default'>Enviar</button>
- </form>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement