Пример #1
0
<?php

$servername = "localhost";
$username = "******";
$password = "******";
$db = 'test';
$dbh = new PDO("mysql:host={$servername}; dbname={$db};", $username, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$data = $_POST['data'];
$type = $_POST['type'];
$values = split(',', $data);
if ($type == 'kit') {
    addKit($values, $dbh);
}
if ($type == 'log') {
    addLog($values, $dbh);
}
if ($type == 'comment') {
    addComment($values, $dbh);
}
if ($type == 'challange') {
    addChallange($values, $dbh);
}
if ($type == 'chComment') {
    addChComment($values, $dbh);
}
if ($type == 'site') {
    addSite($values, $dbh);
}
if ($type == 'like') {
    like($values, $dbh);
Пример #2
0
<?php

$servername = "localhost";
$username = "******";
$password = "******";
$db = 'test';
$dbh = new PDO("mysql:host={$servername}; dbname={$db};", $username, $password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//$json = $_GET['kit'];
if (isset($_GET['kit'])) {
    $json = $_GET['kit'];
    addKit($json, $dbh);
}
if (isset($_GET['log'])) {
    $json = $_GET['log'];
    addLog($json, $dbh);
}
if (isset($_GET['comment'])) {
    $json = $_GET['comment'];
    addComment($json, $dbh);
}
if (isset($_GET['challange'])) {
    $json = $_GET['challange'];
    addChallange($json, $dbh);
}
if (isset($_GET['chComment'])) {
    $json = $_GET['chComment'];
    addChComment($json, $dbh);
}
if (isset($_GET['site'])) {
    $json = $_GET['site'];