Pass value in PHP

0

I have this html which collects data from a post that is done in a .php before

    <input  type="text" class="form-control" name="div" value="<?php $division = $_POST["createDiv"]; echo $division;?>" placeholder="" disabled>

In turn, this form is sent to another .php and I need to drag the $_POST["createDiv"]; to the next .php but naming it with $_POST["div"] does not work.

How could I do it?

Thanks

I edit with part of the form I want to send.

<form class="form-horizontal" action="insertActa.php" method="post" >

<table class="" width="95%" height="200%" align="center" cellspacing="50" cellpading="100" border="0">

<!-- Fila 1 del registro -->

<div class="container">
<div class="form-row" class="center-block">

    <div class="form-group col-md-4">

        <label for="inputName"><b>Nombre division</b></label>

        <input  type="text" class="form-control" name="div" value="<?php $division = $_POST['createDiv']; echo $division;?>" placeholder="">

    </div>

    <div class="form-group col-md-2">
        <label for="inputSurname1"><b>Jornada</b></label>
        <input  type="number" class="form-control" name="jor" min="1" max="18" required>
        </div>

And I want to receive it in the action php, the way to receive it is indifferent to me, I'm trying with:

echo '¡Hola ' . htmlspecialchars($_POST["div"]) . '!';
    
asked by Javi Tercero 20.09.2018 в 12:14
source

1 answer

2

I think the error comes to you when it comes to printing the variable since you have the echo like this:

 <input  type="text" class="form-control" name="div" value="<?php $division = $_POST["createDiv"]; echo $division;?>" placeholder="" disabled>

And you should change the double quotes for simple ones so they do not mix with the html:

<input  type="text" class="form-control" name="div" value="<?php echo $_POST['createDiv'] ?>" placeholder="" disabled>
    
answered by 20.09.2018 / 14:21
source