Example #1
0
<?php

include_once 'Database.php';
$db = new Database("pdb10.runhosting.com", "998905_myblog", "998905_myblog", "1234");
$host = "pdb10.runhosting.com";
// Host name
$username = "******";
// Mysql username
$password = "******";
// Mysql password
$db_name = "998905_myblog";
// Database name
$tbl_name = "post";
// Table name
$db->query("SELECT * FROM post");
echo $db->getJSON();
<?php

include_once '../libs/Database.php';
$db = new Database("pdb10.runhosting.com", "998905_aaron", "998905_aaron", "queenie");
$db->query("SELECT * FROM site_settings");
$admin = json_decode($db->getJSON());
$db2 = new Database("pdb10.runhosting.com", "998905_aaron", "998905_aaron", "queenie");
$db2->query("SELECT * FROM users");
$users = json_decode($db2->getJSON());
$merged->description = $admin->data->description;
$merged->heading = $admin->data->heading;
$merged->email = $admin->data->email;
$merged->username = $users->data->username;
$merged->password = $users->data->password;
echo json_encode($merged);
Example #3
0
	<?php 
if (isset($_POST['submit']) && $_POST['robots'] == "") {
    include_once '../libs/Database.php';
    $success = false;
    $db = new Database("pdb10.runhosting.com", "998905_aaron", "998905_aaron", "queenie");
    $db->query("SELECT * FROM site_settings");
    $json = json_decode($db->getJSON());
    $from = 'From: noreply <*****@*****.**>';
    $to = $json->data->email;
    $subject = 'Contact form on Aaron\'s Auto';
    $body .= "From: " . $_POST['from'] . "\n";
    $body .= "Message: " . $_POST['message'];
    if (mail($to, $subject, $body, $from)) {
        $success = true;
    }
}
?>

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Aaron's Auto</title>
        <link href="../css/styles.css" rel="stylesheet" type="text/css" />
        <link href="../css/dot-luv/jquery-ui.css" rel="stylesheet" type="text/css" /> 
    </head>
    <body>
        <div class="container">
        	<div class="header-wrapper">
            	<div class="header">
                	<img src="../images/aarons-logo.png" />