PHP - Parse error: syntax error, unexpected end of file in

 
Vista:

Parse error: syntax error, unexpected end of file in

Publicado por Ricardo (1 intervención) el 12/01/2019 04:21:14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
 
// define('LBROOT',getcwd()); // LegoBox Root ... the server root
// include("core/controller/Database.php");
 
if(Session::getUID()=="") {
$user = $_POST['mail'];
$pass = sha1(md5($_POST['password']));
 
$base = new Database();
$con = $base->connect();
 $sql = "select * from usuarios where (email= \"".$user."\" or username= \"".$user."\") and password= \"".$pass."\" and is_active=1";
//print $sql;
$query = $con->query($sql);
$found = false;
$userid = null;
$user_P = null;
while($r = $query->fetch_array()){
	$found = true ;
	$userid = $r['id'];
	$user_P=$r['is_admin'];
}
 
if($found==true) {
//	print $userid;
	$_SESSION['user_id']=$userid ;
	$_SESSION['user_P']=$user_P ;
//	setcookie('userid',$userid);
//	print $_SESSION['userid'];
$privilegio=$_SESSION['user_P'];
if ($privilegio==1) {
	print "Cargando ... $user";
	print $_SESSION['user_P'];
	print "<script>window.location='index.php?view=newcategory';</script>";
}elseif($privilegio==0){
	print "<script>window.location='index.php?view=newcategory';</script>";
 
}else {
	print "<script>window.location='index.php?view=login';</script>";
}
 
}else{
	print "<script>window.location='index.php?view=login';</script>";
 
}
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder