forked from mccreeper98/n3
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathverificar.php
40 lines (34 loc) · 1.07 KB
/
verificar.php
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
<?php
session_start();
include 'conexion.php';
$re=mysql_query("select * from cuenta where Correo='".$_POST['mail']."' AND Password='".$_POST['pass']."'") or die(mysql_error());
while ($f=mysql_fetch_array($re)) {
$tip=$f['tipo'];
if ($tip==1) {
$arreglo[]=array('Nombre'=>$f['Nombre'],
'Apellido'=>$f['Apellido'],
'Tipo'=>$f['tipo']);
}elseif ($tip==2) {
$cosa[]=array('Nombre'=>$f['Nombre'],
'Apellido'=>$f['Apellido'],
'Apm'=>$f['apm'],
'Usu'=>$f['Usuario'],
'Pass'=>$f['Password'],
'Correo'=>$f['Correo'],
'Tipo'=>$f['tipo']);
}
}
if(isset($arreglo)){
$_SESSION['Usuario']=$arreglo;
header("Location: index.php");
}elseif (isset($cosa)) {
$_SESSION['Comprador']=$cosa;
if (isset($_POST['ver'])) {
header("Location: carrito/compras.php");
}else{
header("Location: index.php");
}
}else{
header("Location: Login.php?error=datos no validos");
}
?>