code..
<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL);
require_once('conexion.php');
$producto = $_POST['prod'];
$cantidad = $_POST['cant'];
$precio = $_POST['total'];
$cliente = $_POST['nombre'];
$email = $_POST['email'];
$telefono = $_POST['tel'];
$imgData = addslashes(file_get_contents($_POST['userImage']['tmp_name']));
$imageProperties = getimageSize($_POST['userImage']['tmp_name']);
if (empty($_POST['prod'])) {
// code...
echo "<script>alert('no as elejido nada del menu...');history.go(-1);</script>";
// header("location: ../index.php?enviado");
}else{
$sql = "INSERT INTO pagos_hystory
(Producto,Cantidad,Precio,cliente,email_cli,celular,imageType,imageData) VALUES
('$producto','$cantidad','$precio','$cliente','$email','$telefono','{$imageProperties['mime']}',
'{$imgData}')";
$result = mysqli_query($link,$sql);
// header("location: ../index.php?enviado");
// echo ("<script>
// window.alert('Su pedido ha sido enviado con éxito!');
// window.location.href='../';
// </script>");
}
?>
output:
Warning: Illegal string offset 'tmp_name' in D:\xampp\htdocs\wrapp\config\insert_pedido.php on line 13 Warning: file_get_contents(2): failed to open stream: No such file or directory in D:\xampp\htdocs\wrapp\config\insert_pedido.php on line 13 Warning: Illegal string offset 'tmp_name' in D:\xampp\htdocs\wrapp\config\insert_pedido.php on line 14 Warning: getimagesize(2): failed to open stream: No such file or directory in D:\xampp\htdocs\wrapp\config\insert_pedido.php on line 14