Dispongo de esto:
Y me da el siguiente error: (No me deja poner el else if).
Código:
Parse error: syntax error, unexpected end of file in C:\myxampp\htdocs\ee\index.php on line 244
Código PHP:
Ver original
<?php $cantidad = 10; $inicio = ($pg-1) * $cantidad; $registros = mysqli_query($conexion, "SELECT count(*) as Total FROM mensajes") or die(mysqli_error($conexion)); $few3 = mysqli_query($conexion, "SELECT rango FROM ses WHERE id = '".$_SESSION['id']."'")or die(mysqli_error()); if($row3['rango'] == '0'){ $sql111 = mysqli_query($conexion, "SELECT * FROM mensajes WHERE para='".$_SESSION['usuario']."' ORDER BY id DESC LIMIT 40")or die(mysqli_error()); echo "<div class='msg1'></div> <div class='msg2'> <div class='msg4'><a href='http://localhost/sendse/?id=".$cose['ID']."&secret=".$cose['secret']."'>".$cose['asunto']."</a></div><div class='msg5'><a href='http://localhost/perfil/".$cose['de']."'>".$cose['de']."</div><div class='msg6'>".$cose['fecha']."</div> </div> <div class='msg3'></div><div class='pasoespacio'></div>"; } else if($row3['rango'] == '1'){ $sql111 = mysqli_query($conexion, "SELECT * FROM mensajes WHERE para='".$_SESSION['usuario']."' ORDER BY id DESC LIMIT 100")or die(mysqli_error()); echo "<div class='msg1'></div> <div class='msg2'> <div class='msg4'><a href='http://localhost/ee/?id=".$cose['ID']."&secret=".$cose['secret']."'>".$cose['asunto']."</a></div><div class='msg5'><a href='http://localhost/perfil/".$cose['de']."'>".$cose['de']."</div><div class='msg6'>".$cose['fecha']."</div> </div> <div class='msg3'></div><div class='pasoespacio'></div>"; } } if($pg > 1) { $ant = $pg - 1; echo "<div class='yacentercontent'><a href=\"{$_SERVER["PHP_SELF"]}?page=1\">Primera</a></div>"; echo "<div class='yacentercontent'> <a href=\"{$_SERVER["PHP_SELF"]}?page=$ant\">Anterior</a></div>"; } if($pg <= $paginas) { $sig = $pg + 1; echo " <div class='yacentercontent'><a href=\"{$_SERVER["PHP_SELF"]}?page=$sig\">Siguiente</a></div>"; $ult = $paginas + 1; echo " <div class='yacentercontent'><a href=\"{$_SERVER["PHP_SELF"]}?page=$ult\">Última</a></div> "; } } else { echo 'La pagina solicitada no existe'; } ?>
Un cordial saludo.