Código PHP :
<?php
require 'conexion1.php';
$nombre = $_POST["nombre"];
$email = $_POST["email"];
$gamertag = $_POST["gamertag"];
$status = Pendiente;
$permitidos = array("image/jpg", "image/jpeg", "image/gif", "image/png");
$limite_kb =1024;
if (in_array($_FILES['imagen']['type'], $permitidos) && $_FILES['imagen']['size'] <= $limite_kb * 1024)
{
$ruta = "comprobantes/" . $_FILES['imagen']['name'];
move_uploaded_file($_FILES["imagen"]["tmp_name"], $ruta);
}
else{
echo '<script>
alert("error al subir imagen ");
window.history.go(-1);
</script>';
exit;
}
//CONSULTA PARA INSERTAR
$insertar = "INSERT INTO fifa18(nombre, correo, gamertag, comprobante, status) VALUES ('$nombre', '$email', '$gamertag', '$ruta', '$status' )";
//ejecutar consulta
$resultado = mysqli_query ($conexion, $insertar);
if (!$resultado) {
die('No fue posible registrar al usuario intentalo nuevamente');
}
else {
echo 'Usuario Registrado Correctamente';
}
//cerrar conexion
mysqli_close($conexion);
header('Location: mensaje_inscrito.html');
?> 