Ver Mensaje Individual
  #7 (permalink)  
Antiguo 18/05/2016, 12:10
ze3r0o
 
Fecha de Ingreso: mayo-2016
Ubicación: Venezuela
Mensajes: 5
Antigüedad: 8 años
Puntos: 0
Respuesta: Problema en syntax error, unexpected 'echo'

He reescrito el codigo

vi unos errores que tenia pero ahora algo que no termino de comprender

Cita:
<?php
include("conexion.php");
$con=mysql_query("select * from datos");
$reg=mysql_fetch_array($con);
?>

<form action="" method="post">
<select name="datos">
<?php
do{
$codigo=$reg['CODIGO'];
$comercio=$reg['COMERCIO'];
?>
<option value="<?php echo $codigo; ?>"><?php echo $comercio; ?></option>
<?php
}while($reg=mysql_fetch_array($con));
?>
</select>
<input type="submit" name="actu" value="Actualizar" />
</form>
<?php
if(isset($_POST['actu'])){
$datos=$_POST['datos'];
$con1=mysql_query("select *from datos where CODIGO='$datos' ")or die(mysql_error());
$reg1=mysql_fetch_array($con1);
$co=$reg1['CODIGO'];
$c=$reg1['COMERCIO'];
$d=$reg1['DIRECCION'];
$t=$reg1['TELEFONO'];
$n=$reg1['NOMBRE'];
$a=$reg1['ALARMA'];
$m=$reg1['MASTER'];
$i=$reg1['INSTALADOR'];
?>
<form method="post">
CODIGO:<input name="co" value="<?php echo $co; ?>" /><br />
COMERCIO:<input name="c" value="<?php echo $c; ?>" /><br />
DIRECCION:<input name="d" value="<?php echo $d; ?>" /><br />
TELEFONO:<input name="t" value="<?php echo $t; ?>" /><br />
NOMBRE:<input name="n" value="<?php echo $n; ?>" /><br />
ALARMA:<input name="a" value="<?php echo $a; ?>" /><br />
MASTER:<input name="m" value="<?php echo $m; ?>" /><br />
INSTALADOR:<input name="i" value="<?php echo $i; ?>" /><br />
<input type="hidden" name="CODIGO" value="<?php echo $datos ?>" />
<input value="Actualizar" type="submit" name="actufinal" />
</form>

<?php
if(isset ($_POST['actufinal'])){
$co=$_POST['co'];
$c=$_POST['c'];
$d=$_POST['d'];
$t=$_POST['t'];
$n=$_POST['n'];
$a=$_POST['a'];
$m=$_POST['m'];
$i=$_POST['i'];
mysql_query("update datos set co='$co', c='$c', d='$d', t='$t', n='$n', a='$a', m='$m', i='$i'")or die(mysql_error());
echo "<script>alert('date(actu)')location ='actualizar.php'</script>";
}
?>
me dice que el error esta en la ultima linea donde cierro el php -.-

hice una verificacion con una pagina que me revisa el codigo y encuentra el error no se si la puedo mencionar aca pero dice que el error esta en la linea 61 que para mi es el cierre del PHP :s