Foros del Web » Programando para Internet » PHP »

Parse error: syntax error, unexpected T_ELSE

Estas en el tema de Parse error: syntax error, unexpected T_ELSE en el foro de PHP en Foros del Web. Hola amigos, tengo un codigo que me esta dando el siguiente error al ejecutarlo: Parse error : syntax error, unexpected T_ELSE in /mnt/web5/63/73/52556673/htdocs/modificar.php on line ...
  #1 (permalink)  
Antiguo 31/10/2010, 17:06
 
Fecha de Ingreso: agosto-2010
Mensajes: 36
Antigüedad: 13 años, 7 meses
Puntos: 1
Parse error: syntax error, unexpected T_ELSE

Hola amigos, tengo un codigo que me esta dando el siguiente error al ejecutarlo:

Parse error: syntax error, unexpected T_ELSE in /mnt/web5/63/73/52556673/htdocs/modificar.php on line 29

les dejo el codigopara que me ayuden a descubrir donde esta el error:

Código PHP:
?php
    $id
=$_GET['id'];
    
$f=$_GET['f'];
    if(isset(
$_COOKIE['user']) && isset($_COOKIE['pass'])){
        
$pass=trim($_COOKIE['pass']);
        
$user=trim($_COOKIE['user']);
        
mysql_connect("xxxx","xxxxx","xxxxxxx");
        
mysql_select_db("xxxxx");
        
$q=mysql_query("select * from admins where user='$user' and password='$pass'");
        if(
mysql_fetch_array($q)){
            if(
$f==mod){
                
$q1=mysql_query("select * from videos where id='$id'");
                
$r=mysql_fetch_array($q1);
                echo
'<form actio="addvideo.php?id='.$id.'&f=mod" method="post">
                        <input type="text" name="titulo" value"'
.$r['titulo'].'" />
                        <input type="submit" value="Modificar">
                    </form>'
;
            }else{
                if (
$f==del){
                    
$q2=mysql_query("select * from videos where id='$id'");
                    
$r1=mysql_fetch_array($q2);
                    echo
'<form onsubmit="return confirm(\'Está Seguro\')" action="addvideo.php?id='.$id.'&f=del" method="post">
                        <input type="hidden" name="query" value="inecesario" />
                        <h3>'
.$r1['titulo'].'<h3><br>
                        <input type="submit" value="Borrar" />
                        </form>'
;
                }else{
                    
header("location:admin.php");
            }else{
                
header("location:admin.php");
        }else{
            
header("location:admin.php");
        }
?> 
Gracias de antemano por su tiempo!
  #2 (permalink)  
Antiguo 31/10/2010, 17:31
 
Fecha de Ingreso: enero-2008
Mensajes: 132
Antigüedad: 16 años, 3 meses
Puntos: 6
Respuesta: Parse error: syntax error, unexpected T_ELSE

Código PHP:
<?php
$id
=$_GET['id'];
$f=$_GET['f'];

if(isset(
$_COOKIE['user']) && isset($_COOKIE['pass']))
    {
    
$pass=trim($_COOKIE['pass']);
    
$user=trim($_COOKIE['user']);
    
mysql_connect("xxxx","xxxxx","xxxxxxx");
    
mysql_select_db("xxxxx");
    
$q=mysql_query("select * from admins where user='$user' and password='$pass'");
    if(
mysql_fetch_array($q))
        {
        if(
$f==mod)
            {
            
$q1=mysql_query("select * from videos where id='$id'");
            
$r=mysql_fetch_array($q1);
            echo
'<form actio="addvideo.php?id='.$id.'&f=mod" method="post">
            <input type="text" name="titulo" value"'
.$r['titulo'].'" />
            <input type="submit" value="Modificar">
            </form>'
;
            }
        else
            {
            if (
$f==del)
                {
                
$q2=mysql_query("select * from videos where id='$id'");
                
$r1=mysql_fetch_array($q2);
                echo
'<form onsubmit="return confirm(\'Está Seguro\')" action="addvideo.php?id='.$id.'&f=del" method="post">
                <input type="hidden" name="query" value="inecesario" />
                <h3>'
.$r1['titulo'].'<h3><br>
                <input type="submit" value="Borrar" />
                </form>'
;
                }
            else
                {
                
header("location:admin.php");
                }
            }
        }
    else
        {
        
header("location:admin.php");
        }
    }
else
    {
        
header("location:admin.php");
        }
?>
__________________
surfiction.org
  #3 (permalink)  
Antiguo 31/10/2010, 18:16
 
Fecha de Ingreso: agosto-2010
Mensajes: 36
Antigüedad: 13 años, 7 meses
Puntos: 1
Respuesta: Parse error: syntax error, unexpected T_ELSE

Muchas gracias Surfiction

¿ como te puedo dar karma?
( esque no se como va ese tema jeje )

Etiquetas: parse, syntax
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:01.