<?php

function conectar() {

	$conect	 = @mysql_connect('localhost','root','');
	$banco	 = mysql_select_db('spotcasa_db');
}

function limpa($word, $nChar=999) {

	$word = substr($word, 0, $nChar);
	
	$word = strip_tags($word);
	$word = addslashes($word);
	$word = trim($word);
	$word = htmlspecialchars($word);
	
	return $word;	
}

function makeValues($values)
{
    
    $procura = array('INSERT','UPDATE','DELETE','DROP','SELECT','CREATE','FROM');
    $word = str_replace("INTO", "há", $values);
       
    
    $word = strip_tags($values);
    $word = htmlspecialchars($values);
    $word = trim($values);
         
    return $word;
}

function dateToBD($date)
{
    
    $date = explode('/', $date);
    $date = $date[2]."-".$date[1]."-".$date[0];
    return $date;
    
}

function dateFromBD($date)
{
    
    $date = explode("-", $date);
    $date = $date[2]."/".$date[1]."/".$date[0];
    return $date;            
    
}

conectar();

?>