Promoção

[insert_php]
if(isset($_POST[‘nome’]) || !empty($_POST[‘nome’])){
$servername = “localhost”;
$username = “th120455_wrdp1”;
$password = “eOLC#x_{sDW3”;
$dbname = “th120455_wrdp1”;

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die(“Connection failed: ” . $conn->connect_error);
}

$nome = $_POST[‘nome’];
$cpf = $_POST[‘cpf’];
$loja = $_POST[‘lojas’];
$email = $_POST[‘email’];
$telefone= $_POST[‘telefone’];

$data = date(“d-m-Y”);
$data2 = date(‘d/m/Y’, strtotime(“+2 days”,strtotime($data)));

$sql = “INSERT INTO TPromocao”. “(Nome,Cpf,loja,Data,Email,Telefone) “. “VALUES(‘$nome’,’$cpf’,’$loja’,’$data2′,’$email’,’$telefone’)”;

if ($conn->query($sql) == TRUE) {
echo “New record created successfully”;
} else {
echo “Error: ” . $sql . “
” . $conn->error;
}

$sql2 = “select max(id) as id from TPromocao”;

$result = $conn->query($sql2);

if ($result->num_rows > 0) {
$row = $result->fetch_assoc();
$id=$row[‘id’];
// $cpf=$row[‘Cpf’];
echo $id;
}

$conn->close();
header(‘Location: /exibe?id=’. $id);

//mysql_query($sql);

//echo “escreveescreveescreveescreveescreveescreveescreveescreve”;
echo $day;
}
[/insert_php]

Imprima seu cupom de desconto

*Leia o regulamento



Pin It on Pinterest