-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
31 lines (24 loc) · 947 Bytes
/
insert.php
File metadata and controls
31 lines (24 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require 'config/db.php';
session_start();
$user_id = $_SESSION['user_id'];
$empresa = $_POST['empresa'];
$contato = $_POST['contato'];
$cargo = $_POST['cargo'];
$telefone = $_POST['telefone'];
$celular = $_POST['celular'];
$site = $_POST['site'];
$email = $_POST['email'];
$endereco = $_POST['endereco'];
$bairro = $_POST['bairro'];
$cidade = $_POST['cidade'];
$uf = $_POST['uf'];
$cep = $_POST['cep'];
$pdo = connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO contatos (user_id, empresa, contato, cargo, telefone, celular, site, email, endereco, bairro, cidade, uf, cep) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)";
$q = $pdo->prepare($sql);
$q->execute(array($user_id,$empresa,$contato,$cargo,$telefone,$celular,$site,$email,$endereco,$bairro,$cidade,$uf,$cep));
disconnect();
header("Location: index.php");
?>