Yes,
liljester trying to obtain $_POST values from generated buttons will always works, I thought that that had to be the problem,
I've tryied to check everything, this is the script that must be causing the error, but works...
Code: Select all
<?php
$conn = mysql_connect($site,$user,$pass) or die(mysql_error());
mysql_select_db("db",$conn) or die(mysql_error());
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">
<label>Eliminar fotos de:</label><br /><select name="evento">';
$queryResult = mysql_query("SELECT * FROM eventos");
if(mysql_num_rows($queryResult)==0){
echo "<option>No hay Eventos</option>";
} else {
while($result = mysql_fetch_assoc($queryResult)){
echo '<option>'.$result["eventotitulo"].'</option>';
}
mysql_free_result($queryResult);
}
echo '</select><br /><br />
<input type="submit" class="button" value="Mostrar Fotos" name="submit2" />
</form>';
if(isset($_POST['submit2'])){
$evento = $_POST['evento'];
$queryResult = mysql_query("SELECT * FROM eventos WHERE eventotitulo='".$evento."'");
if(mysql_num_rows($queryResult)==0){
echo "No hay Eventos";
} else {
while($result = mysql_fetch_assoc($queryResult)){
$fotos = $result['eventofotos'];
$descripcion = $result['eventodescripcionfotos'];
$fotos = explode(',',$fotos);
$descripcion = explode(',',$descripcion);
$i = "";
echo "Haz click sobre cualquier imagen para eliminarla permanentemente.<br /><br /><br />";
echo "<form action='".$_SERVER['PHP_SELF']."' method='POST'>";
foreach($fotos as $i){
echo "<label>eliminar<input type='checkbox' name='eliminar".$i."'></label><br />
<img src='../images/eventos/".$i."' width='50' height='50' />
<input type='text' name='desc".$i."' size=40 /><label>Descripcion Nueva</label>";
}
echo "<input type='submit' class='button' value='Actualizar Descripciones' name='submit3' />
</form>";
I've checked and the code above seems to works perfectly, but:
Code: Select all
if($_POST['submit3']){
/* this won't execute */
?>
I've even rewritten the whole previous script in order to make it do the same functions, but using $_GET values, from the URL, but it won't detect them neither.
I also tried to debug it using FireBug, and the Chrome's development tools, and everything seems to be right, there's no HTML errors.