-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRealizaCadastroVaga.php
More file actions
40 lines (36 loc) · 933 Bytes
/
RealizaCadastroVaga.php
File metadata and controls
40 lines (36 loc) · 933 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
32
33
34
35
36
37
38
39
40
<!DOCTYPE HTML>
<html>
<head>
<title>Cadastrando...</title>
</head>
<body>
<?php
$host = "localhost";
$user = "root";
$pass = "";
$banco = "user";
$conn = mysql_connect($host,$user,$pass) or die (mysql_error());
mysql_select_db($banco) or die(mysql_error());
$setor = $_POST['setor'];
$vcarro= $_POST['vcarro'];
$valor = $_POST['valor'];
function pv($pv_var){
//muda ponto para virgula ou vice-versa
//ex. x=pv("100.00"); o resultado será 100,00
//ex. x=pv("100,00"); o resultado será 100.00
$pv_tipo=',';
if ($pv_tipo == '.') {
return str_replace('.',',',$pv_var);
} else {
return str_replace(',','.',$pv_var);
}
}
$valor = pv($valor);
$sql = mysql_query("INSERT INTO vaga (setor, vcarro, valor)
VALUES ('$setor', '$vcarro', '$valor')") or die (mysql_error());
header("Location: sucesso.php");
mysql_close();
?>
<center><a href="paginicial.php">Voltar</a></center>
</body>
</html>