Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class basededados
- {
- var $servidor;
- var $username;
- var $password;
- var $bd;
- var $ligacao;
- function basededados()
- {
- $this->servidor = "localhost";
- $this->username = "root";
- $this->password = "";
- $this->bd = "lvirtual";
- }
- function conectar()
- {
- $this->ligacao = mysql_connect($this->servidor,$this->username,$this->password);
- mysql_select_db($this->bd);
- }
- function query($query)
- {
- return(mysql_query($query, $this->ligacao));
- }
- function fetch($fetch)
- {
- return mysql_fetch_array($request);
- }
- function logado()
- {
- session_start();
- if(isset($_SESSION['acesso'])){
- $a = $_SESSION['acesso'];
- if($a == 0){ header("location:index.php");}
- }else{
- header("location:login.php");
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment