Example #1
0
<?php

require_once 'Database.php';
$nome = $_POST['nome'];
$email = $_POST['email'];
$tel = $_POST['tel'];
$mensagem = $_POST['mensagem'];
$db = new Database();
$db->insertRow("INSERT INTO mensagens VALUES('{$id}', '{$nome}', '{$email}', '{$tel}', '{$mensagem}', now())");
header('Location: ../../contato.php');
<?php

require_once 'Database.php';
$titulo = $_POST['titulo'];
$tamanho = $_POST['tamanho'];
$preco = $_POST['preco'];
$db = new Database();
$db->insertRow("INSERT INTO colchoes VALUES('{$id}', '{$titulo}', '{$tamanho}', '{$preco}')");
// redirecione para a lista de cadastros
header('Location: ../colchoes.php');
Example #3
0
<?php

require_once 'core/init.php';
$date = $_POST['date'];
$ip = $_POST['ip'];
$url = $_POST['url'];
$ua = $_POST['user_agent'];
$os = $_POST['os'];
if (isset($date) && isset($ip) && isset($url) && isset($ua) && isset($os)) {
    $db = new Database();
    if (clearDate($date) !== NULL && clearIp($ip) !== NULL && clearStr($ua) !== NULL && clearStr($os) !== NULL) {
        $db->insertRow("INSERT INTO stats(date, url, ip_address, user_agent, os) VALUES(?, ?, ?, ?, ?)", [$date, $ip, $url, escape(ieDetect($ua)), escape(osDetect($os))]);
    }
} else {
    Redirect::to('index.php');
}
Example #4
0
<?php

require_once 'Database.php';
$usuario = $_POST['user'];
$email = $_POST['email'];
$senha = $_POST['senha'];
$db = new Database();
$db->insertRow("INSERT INTO admin VALUES('{$id}', '{$usuario}', '{$email}', '{$senha}')");
// redirecione para a lista de cadastros
header('Location: ../cadastros.php');
Example #5
0
            $dbpass = Input::get('dbpass');
            if (file_put_contents("core/db.php", '<?php $db = ["host" => "' . $host . '", "dbname" => "' . $dbname . '", "dbusername" => "' . $dbusername . '", "dbpass" => "' . $dbpass . '"];')) {
                Redirect::to('install.php');
            }
        } else {
            $err = $validate->errors();
        }
    }
}
if (Input::exists() && Input::get('createuser')) {
    if (Token::check(Input::get('token'))) {
        $validate = new Validation();
        $validation = $validate->check($_POST, ['username' => ['required' => TRUE, 'min' => 2, 'max' => 50], 'password' => ['required' => TRUE, 'min' => 3], 'repassword' => ['required' => TRUE, 'matches' => 'password']]);
        if ($validate->passed()) {
            $db = new Database();
            if ($db->insertRow("CREATE TABLE stats (\r\n             id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n             date VARCHAR(10) NOT NULL,\r\n             url VARCHAR(255) NOT NULL,\r\n             ip_address VARCHAR(255) NOT NULL,\r\n             user_agent VARCHAR(50) NOT NULL,\r\n             os VARCHAR(50) NOT NULL\r\n             )", []) == TRUE) {
                if ($db->insertRow("CREATE TABLE users (\r\n                 id INT(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,\r\n                 username VARCHAR(50) NOT NULL,\r\n                 password VARCHAR(255) NOT NULL,\r\n                 salt VARCHAR(255) NOT NULL\r\n                 )", []) == TRUE) {
                    $token = Input::get('token');
                    $userPassword = Hash::make(Input::get('password'), $token);
                    $db->insertRow("INSERT INTO users(username, password, salt) VALUES(?, ? , ?)", [Input::get('username'), $userPassword, $token]);
                    Redirect::to('login.php');
                }
            }
        } else {
            $err = $validate->errors();
        }
    }
}
?>
<!doctype html>
<html>