Last active
September 26, 2015 14:49
-
-
Save samuelhei/4cbfd8ecd5af9068099e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BD { | |
function BD(){ | |
$hostname = 'localhost'; | |
$username = $_ENV['C9_USER']; | |
$senha = ''; | |
$banco = 'oficina'; | |
$db = mysql_connect($hostname, $username,$senha); | |
$con = mysql_select_db($banco, $db); | |
$this->con = $con; | |
} | |
function query($sql) { | |
$query = mysql_query($sql); | |
if(mysql_errno() > 0) { | |
if(debug) { | |
die( mysql_error().' ('.$sql.')' ); | |
} | |
} | |
return $query; | |
} | |
function multiple($sql) { | |
$return = array(); | |
$query = $this->query($sql); | |
while($data = mysql_fetch_array($query)){ | |
$return[] = $data; | |
} | |
return $return; | |
} | |
function single($sql) { | |
$query = $this->query($sql); | |
return mysql_fetch_array($query); | |
} | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="large-12 columns"> | |
<?php | |
$bad = array('.', '/', '%',chr(92)); | |
$id = str_replace($bad,'',$_GET['acao']); | |
if(empty($id)) { | |
$id = 'login'; | |
} | |
include('go/aplick/'.$id.'.php') | |
?> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="small-12 medium-6 columns"> | |
<form action="<?php echo urlSite; ?>/go/controle/login.php" method="POST"> | |
<label for="login">Login:</label> | |
<input type="email" name="login" id="login"/> | |
<label for="senha">Senha</label> | |
<input type="password" name="senha" id="senha"/> | |
<input type="submit" class="button" value="Entrar"/> | |
</form> | |
</div> | |
</div>1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto_prepend_file = "/home/ubuntu/workspace/go/config.php" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('funcoesBanco.php'); | |
class Usuario { | |
var $login; | |
var $nome; | |
var $senha; | |
function Usuario(){ | |
$bd = new BD(); | |
} | |
function login(){ | |
$login = $this->getLogin(); | |
$senha = $this->getSenha(); | |
$sql = 'select * from usuario | |
where login = "'.$login.'" | |
and senha = "'.$senha.'"'; | |
return $this->bd->single($sql); | |
} | |
function setLogin($login) { | |
$this->login = $login; | |
} | |
function setNome($nome) { | |
$this->nome =$nome; | |
} | |
function setSenha($senha){ | |
$this->senha = $senha; | |
} | |
function getLogin(){ | |
return $this->login; | |
} | |
function getNome(){ | |
return $this->nome; | |
} | |
function getSenha(){ | |
return $this->senha; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment