registrar.php:
Código PHP:
<?php
if(isset($_POST['enviar'])=='send'){
$mysqli = new mysqli("localhost", "mxdiario_boleton", "i(!54.+l&,P1", "mxdiario_boletos", 3306);
if ($mysqli->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error); }
$select = $mysqli->query("SELECT * FROM participantes");
while($select_row = $select->fetch_array(MYSQLI_ASSOC)){
if($_POST['emaili']==$select_row['email'] or $_POST['ipaddress']==$select_row['ipaddress']){
echo '<script type="text/javascript">window.location="http://eldiariodigital.mx/boletos-fich/index.php?ok=existente";</script>';
exit();
}
}
$fechahora = date('Y-m-d H:i:s');
$mysqli->query("INSERT INTO participantes (fh_ingreso, nombre, email, telefono, boletos, fecha, hora, ipaddress) VALUES (
'".$fechahora."',
'".$_POST['nombre']."',
'".$_POST['emaili']."',
'".$_POST['telefono']."',
'".$_POST['boletos']."',
'".$_POST['fecha']."',
'".$_POST['hora']."',
'".$_POST['ipaddress']."')");
header("Location: index.php?ok=ok");
}
?>