I am sending a variable by GET method
while ($row = $resultado->fetch_assoc()) {
$html .= '<tr>';
//$html .= '<td>' . $row['Incrementable'] . '</td>';
$html .= '<td>' . $row['CvePersonal'] . '</td>';
$html .= '<td>' . $row['CtaBanco'] . '</td>';
$html .= '<td>' . $row['CveContrato'] . '</td>';
$html .= '<td>' . $row['TipoEmpleado'] . '</td>';
$html .= '<td>' . $row['Inicio'] . '</td>';
$html .= '<td>' . $row['Fin'] . '</td>';
$html .= '<td>' . $row['UltDia'] . '</td>';
$html .= '<td>' . $row['CodCategoria'] . '</td>';
$html .= '<td>' . $row['PrimaVac'] . '</td>';
$html .= '<td>' . $row['HrsMen'] . '</td>';
$html .= '<td>' . $row['CostoHra'] . '</td>';
$clave = $row['Incrementable'];
$html .= '<td>
<a href="depurar.php?Incrementable=$clave"><img src="img/expedientes/editar.png" height="40" width="40" /></a>
</td>';
$html .= '<td><img src="img/expedientes/eliminar.png" height="40" width="40" title="Eliminar"></td>';
$html .= '</td>';
}
I need to send the key variable, I know that to send by GET method it is with the syntax that I wrote, the problem is that if I use ''
for the variable $clave
it sends me a syntax error, as it is written only a text string arrives$clave
I hope I have been clear with my question, first of all, thank you very much
You're using single quotes to assign this:
and inside, if you notice, you try to use the variable $key, which is never resolved like this with single quotes, because it is not interpreted as such.
Try concatenation notation like so:
let's see if you can fix it.
Keep in mind that using single quotes is not the same as using double quotes, since double quotes do interpret PHP variables, but in this case, if you used them, it would have to be like this:
which I do not recommend because you must escape all the double quotes that they contain, although if you pay attention to the $key it is no longer concatenated and it would be resolved well.
Here you will find more information about the differences between single and double quotes .