-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTituloPerfilAlterado.php
More file actions
52 lines (37 loc) · 1.89 KB
/
TituloPerfilAlterado.php
File metadata and controls
52 lines (37 loc) · 1.89 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
<html>
<head>
<title> - myWeb - </title>
<link rel="stylesheet" type="text/css" href="estilo.css"/>
<link rel="shortcut icon" href="MY_WEB-LOGO/favicon.ico" type="image/x-icon"/>
</head>
<body>
<?php
include"based.php";
if((empty($_POST['NovoPerfil']))||(empty($_POST['NovoPerfilSobrenome']))){
echo"<script>alert('Voce deixou um campo em branco!'); history.go(-1);</script>";
}
//$mudar=isset($_POST['mudar'])?$_POST['mudar']:null;
$novoPerfil=isset($_POST['NovoPerfil'])?$_POST['NovoPerfil']:null;
$novoPerfil=str_replace(" ","_",$novoPerfil);
$novoPerfilSobrenome=isset($_POST['NovoPerfilSobrenome'])?$_POST['NovoPerfilSobrenome']:null;
$novoPerfilSobrenome=str_replace(" ","_",$novoPerfilSobrenome);
$novoPerfilCompleto=strtolower($novoPerfil.'_'.$novoPerfilSobrenome);
//$novoPerfil=str_replace(" ","_",$novoPerfil);
//$novoPerfil1=str_replace(" ","_",$novoPerfil);
$novoPerfilCompleto1=strtolower($novoPerfil.'_'.$novoPerfilSobrenome);
$novoPerfilCompletoMaiusc=strtoupper($novoPerfilCompleto1);
//$novoPerfil1=strtoupper($novoPerfil);
//$novoPerfil1=str_replace(" ","_",$novoPerfil1);
$Perfil=$_GET['titulo'];
$PerfilMaiusc=strtoupper($Perfil);
//$conta=@mysql_query("SELECT contatos FROM $novoPerfil WHERE contatos='$novoPerfil';",$conexao);
$alteraTabela=@mysql_query("RENAME TABLE $Perfil To $novoPerfilCompleto;", $conexao);
$alteraContato=@mysql_query("UPDATE $novoPerfilCompleto SET contatos='$novoPerfilCompleto' WHERE codigo=1;",$conexao);
$alteraNome=@mysql_query("UPDATE _users SET tituloPerfil='$novoPerfilCompletoMaiusc' WHERE tituloPerfil ='".strtoupper($Perfil)."';",$conexao);
if($alteraTabela){
echo"<script>alert('Contato ".str_replace("_"," ",$novoPerfilCompleto).", atualizado com sucesso!'); history.go(-2);</script>";}
else{
echo"<script>alert('Contato ".str_replace("_"," ",$novoPerfilCompleto).", nao pode ser atualizado!'); history.go(-2);</script>";}
?>
</body>
</html>