mod_sql/4.3: unrecoverable backend error: (1136) Column count doesn't match value count at row 1
SQLLog RETR,STOR handle
SQLNamedQuery handle INSERT "'', '%f', %b, '%u', now()" uploadhistory
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
{% extends 'layout.twig' %}
{% block content %}
{% block info %}{% endblock %}
{% endblock %}
{% extends 'index.twig' %}
{% block info %}Hello World{% endblock %}
<?php
function post($url, $data) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close ($ch);
return $output;
}
echo post("https://google.com", [
'foo' => 'bar'
]);
session_start();
$currentCookieParams = session_get_cookie_params();
$sidvalue = session_id();
if(!isset($_COOKIE['PHPSESSID'])) {
setcookie(
'PHPSESSID', //name
$sidvalue, //value
0, //expires at end of session
$currentCookieParams['path'], //path
$currentCookieParams['domain'], //domain
true //secure
);
}
<?php
$email = "john.doe@example.com";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
echo("$email is a valid email address");
} else {
echo("$email is not a valid email address");
}
?>
<?php
$template = implode("\n", [
'<!DOCTYPE html>',
'<html lang="en">',
'<head>',
'<meta charset="UTF-8">',
'<title>Document</title>',
'</head>',
'<body>',
'<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima consectetur placeat, doloribus, qui eaque quas laborum fuga voluptas dolorum distinctio illo quibusdam quia cum, inventore quos. Quo ipsam sed asperiores.</p>',
'</body>',
'</html>'
]);
$response = array(
"html" => urlencode($template),
"show" => 'true'
);
header('Content-type: application/json; charset=utf-8');
$json = json_encode($response);
echo $json;
?>
<script>
var data = new FormData();
data.append("foo", "bar");
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(decodeURIComponent(this.responseText));
}
});
xhr.open("GET", "/ajax");
xhr.send(data);
</script>
<?php
function parseAudio($message) {
$matches = [];
$s = preg_match('/\[audio (.*?)\]/', $message, $matches);
return str_replace($matches[0], "<audio controls><source src=\"{$matches[1]}\" type=\"audio/wav\"></audio>", $message);
}
echo parseAudio("Message with audio\n[audio records/1517754431.wav]");
?>
from flask import Flask
application = Flask(__name__)
@application.route("/")
def hello():
return "<h1 style='color:blue'>Hello There!</h1>"
if __name__ == "__main__":
application.run(host='0.0.0.0')
<?php
// Import PHPMailer classes into the global namespace
// These must be at the top of your script, not inside a function
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load composer's autoloader
require 'vendor/autoload.php';
$mail = new PHPMailer(true); // Passing `true` enables exceptions
try {
//Server settings
$mail->SMTPDebug = 2; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp1.example.com;smtp2.example.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'user@example.com'; // SMTP username
$mail->Password = 'secret'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom('from@example.com', 'Mailer');
$mail->addAddress('joe@example.net', 'Joe User'); // Add a recipient
$mail->addAddress('ellen@example.com'); // Name is optional
$mail->addReplyTo('info@example.com', 'Information');
$mail->addCC('cc@example.com');
$mail->addBCC('bcc@example.com');
//Attachments
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
//Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "/ajax.php",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n-----011000010111000001101001--\r\n",
CURLOPT_HTTPHEADER => array(
"content-type: multipart/form-data; boundary=---011000010111000001101001"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->addForm(array(
'foo' => 'bar'
), NULL);
$request->setRequestUrl('/ajax.php');
$request->setRequestMethod('POST');
$request->setBody($body);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
<?php
# подключаемся к базе данных
try {
$DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
$DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}catch(PDOException $e) {
echo "Хьюстон, у нас проблемы.";
}
# данные, которые мы вставляем
$data = [
'type' => $_GET['type']
];
# делаем запрос
$STH = $DBH->prepare("select * from catalog where catalog.type = :type order by catalog.id desc");
$STH->execute($data);
# устанавливаем режим выборки
$STH->setFetchMode(PDO::FETCH_ASSOC);
# выводим результат
while($row = $STH->fetch()) {
echo "<div class=\"item active\">{$row['name']} - {$row['price']}</div>";
}
?>