Last active
August 12, 2018 17:26
-
-
Save luisdavid919/8068a439bfeec56d689a102dda91a102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'config.php'; | |
// Create connection | |
//$conn = new mysqli($servername, $username, $password, $dbname); | |
// Check connection | |
//if ($conn->connect_error) { | |
// die("Conexión Fallida: " . $conn->connect_error); | |
//} | |
$fecha=$_POST['fecha']; | |
$hora=$_POST['hora']; | |
$puerta=$_POST['puerta']; | |
$guardia=$_POST['guardia']; | |
$id=$_POST['id']; | |
$yesno=$_POST['yesno']; | |
$pas1=$_POST['pas1']; | |
$id1=$_POST['id1']; | |
$pas2=$_POST['pas2']; | |
$id2=$_POST['id2']; | |
$pas3=$_POST['pas3']; | |
$id3=$_POST['id3']; | |
$trabajador=$_POST['trabajador']; | |
$jefe=$_POST['jefe']; | |
$destino=$_POST['destino']; | |
$tax=$_POST['tax']; | |
$motivo=$_POST['motivo']; | |
$sql = "INSERT INTO worklist (fecha,hora,puerta,guardia,id,yesno,pas1,id1,pas2,id2,pas3,id3,trabajador,jefe,destino,tax,motivo) VALUES ('$fecha', '$hora','$puerta','$guardia','$id','$yesno','$pas1','$id1','$pas2','$id2','$pas3','$id3', '$trabajador','$jefe','$destino','$tax','$motivo');"; | |
if ($conn->query($sql) === TRUE) { | |
echo "Información Agregada con Éxito"; | |
header("location: trabajo.php"); | |
} else { | |
echo "Error: " . $sql . "<br>" . $conn->error; | |
} | |
$conn->close(); | |
?> |
si quieres comparteme el proyecto a mi gitHub yo miro haber en que te ayudo nombre de usuario: jjrr13
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Debes capturar primero todas las variables que llegan por POST asi:
$folio =$_POST['folio'];
$fecha =$_POST['fecha'];
hora =$_POST['hora'];
$puerta =$_POST['puerta'];
$guardia =$_POST['guardia'];
$id =$_POST['id'];
$yesno =$_POST['yesno'];
$pas1 =$_POST['pas1'];
$id1 =$_POST['id1'];
$pas2 =$_POST['pas2'];
$id2 =$_POST['id2'];
$pas3 =$_POST['pas3'];
$id3 =$_POST['id3'];
$trabajador =$_POST['trabajador'];
$jefe =$_POST['jefe'];
$destino =$_POST['destino'];
$tax =$_POST['tax'];
$motivo =$_POST['motivo'];
ReNiceCode...