daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. include '../Model/conectarBD.php';
  3.  
  4. class login{
  5.  
  6. public $nome;
  7. public $senha;
  8. private $db;
  9.  
  10.  
  11. public function __construct($nome,$senha){
  12.     $this->nome = $nome;
  13.     $this->senha = $senha;
  14. }
  15.  
  16.  
  17. public function registrarDados($usuario,$senha)
  18. {
  19.       $Obj_Conexao = new CONEXAO();
  20.       $inserirDados = $Obj_Conexao->Inserir("INSERT INTO login (usuario,senha) VALUES ('$usuario','$senha')");
  21.  
  22.       $Obj_Conexao->inserir;
  23.  
  24. }
  25.    
  26. <?php
  27. class Conexao{
  28.     public $usuario = "root";
  29.     public $senha = "";
  30.     public $sid = "localhost";
  31.     public $banco = "socialwars";
  32.     public $consulta = "";
  33.     function Conexao(){
  34.  
  35.     }
  36.  
  37. function conectar() {
  38.     $this->link = mysql_connect($this->sid,$this->usuario,$this->senha);
  39.  
  40.     if (!$this->link)
  41.     {
  42.                 die("Problema na Conexão com o Banco de Dados");
  43.     }
  44.             elseif (!mysql_select_db($this->banco,$this->link))
  45.             {
  46.                 die("Problema na Conexão com o Banco de Dados");
  47.     }
  48. }
  49.  
  50. function Desconecta()
  51. {
  52.         return mysql_close($this->link);
  53.  
  54. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top