initial commit
This commit is contained in:
30
prestadores/inc_pre.php
Normal file
30
prestadores/inc_pre.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
if (session_status() !== PHP_SESSION_ACTIVE){
|
||||
session_start();
|
||||
}
|
||||
$nome=(empty($_POST["nome"])) ? " ": $_POST["nome"];
|
||||
$endereco=(empty($_POST["endereco"])) ? " ": $_POST["endereco"];
|
||||
$complemento=(empty($_POST["complemento"])) ? " ": $_POST["complemento"];
|
||||
$bairro=(empty($_POST["bairro"])) ? " ": $_POST["bairro"];
|
||||
$cidade=(empty($_POST["cidade"])) ? " ": $_POST["cidade"];
|
||||
$estado=(empty($_POST["estado"])) ? " ": $_POST["estado"];
|
||||
$cep=(empty($_POST["cep"])) ? " ": $_POST["cep"];
|
||||
$email=(empty($_POST["email"])) ? " ": $_POST["email"];
|
||||
$telefone=(empty($_POST["telefone"])) ? 0.0: $_POST["telefone"];
|
||||
$celular=(empty($_POST["celular"])) ? 0.0: $_POST["celular"];
|
||||
include("../conexao.php");
|
||||
|
||||
$query= "INSERT INTO prestadores (nome, endereco, complemento, bairro, cidade, estado, cep, email, telefone, celular)
|
||||
VALUES ('$nome', '$endereco', '$complemento', '$bairro', '$cidade', '$estado', '$cep', '$email', '$telefone', '$celular')";
|
||||
$resu= mysqli_query($con,$query);
|
||||
if (mysqli_insert_id($con)) {
|
||||
$_SESSION['msg']= "<p style='color:blue;'> Prestador cadastrado com sucesso!</p>";
|
||||
header('Location: index.php');
|
||||
}
|
||||
else{
|
||||
$_session['msg']= "<p style='color:red;'> Prestador não foi cadastrado!</p>";
|
||||
header('Location: index.php');
|
||||
}
|
||||
|
||||
mysqli_close($con);
|
||||
?>
|
Reference in New Issue
Block a user