Skip to content

Commit

Permalink
Arrumado configurar perfil
Browse files Browse the repository at this point in the history
  • Loading branch information
kaway404 authored Dec 8, 2017
1 parent 7d516ef commit 039352b
Show file tree
Hide file tree
Showing 3 changed files with 243 additions and 163 deletions.
47 changes: 42 additions & 5 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,51 @@

<div class="pagar">
<h1>Editando perfil</h1>
<form class="paypal" action="payments.php" method="post" id="paypal_form" target="_blank">
<input type="text" name="first_name" value="" placeholder="Nome" />
<input type="text" name="last_name" value="" placeholder="Sobrenome" />
<input type="text" name="last_name" value="" placeholder="Nome de usuario" />
<center><input class="pagare" type="submit" name="submit" value="Concluir"/></center>
<form class="editar" method="post">
<input type="text" name="first_name" value="" id="name" placeholder="Nome" />
<input type="text" name="last_name" value="" id="sobname" placeholder="Sobrenome" />
<input type="text" name="last_name" value="" id="username" placeholder="Nome de usuario" />
<center><input class="pagare" type="submit" name="submit" value="Concluir" id="concluido"/></center>
</form>
</div>

<div id="resposta">

</div>
<style>
#resposta{
width: 45vw;
color: red;
position: relative;
top: 8vw;
margin: 0px auto;
text-align: center;
border-radius: 0.3vw;
font-size: 1.5vw;
background: #000;
height: auto;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("#concluido").click(function() {
var name = $("#name");
var namePost = name.val();
var sobname = $("#sobname");
var sobnamePost = sobname.val();
var username = $("#username");
var usernamePost = username.val();
$.post("/configurandop.php?config1=<?Php echo $user['idcry']; ?>", {name: namePost,sobname: sobnamePost,username: usernamePost,},
function(data){
$("#resposta").html(data);
}
, "html");
return false;
});
});
</script>

</body>

</html>
Expand Down
37 changes: 37 additions & 0 deletions configurandop.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
require 'static/php/system/database.php';
require 'static/php/system/config.php';
$nome = $_POST['name'];
$sobname = $_POST['sobname'];
$username = $_POST['username'];

//Abrindo Conexao com o banco de dados
$conexao = mysql_pconnect($hostp, $userp, $passwrdp) or die (mysql_error());
$banco = mysql_select_db($dbp);

//Utilizando o mysql_real_escape_string voce se protege o seu código contra SQL Injection.

$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );
$ip=mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');
$iduser = DBEscape( strip_tags(trim($_COOKIE['iduser']) ) );


if (!($nome) || !($sobname) || !($username) ){
echo '<p>Preencha todos os campos</p>';
}
else{
$userUP['nome'] = $nome;
$userUP['sobname'] = $sobname;
$userUP['username'] = $username;
if( DBUpdate( 'user', $userUP, "id = '{$iduser}'" ) ){
echo 'Sucesso';
}
else{
echo 'Ocorreu um erro';
}
}
?>
Loading

0 comments on commit 039352b

Please sign in to comment.