$result = $mysqli->query("SELECT * FROM `entry` WHERE `descr` LIKE '%{$query}%' OR `content` LIKE '%{$query}%' OR `title` LIKE '%{$query}%'");
$fp = @fsockopen("tcp://".$host, 80, $errno, $errstr, 10);
if (!$fp)
{
die($errstr.':'.$errno);
}
else
{
$out = "GET $path HTTP/1.0\r\n";
$out .= "Host: $host\r\n";
//авторизируемся
$out .= "Authorization: Basic " . base64_encode("$user:$password") . "\r\n";
$out .= "Connection: Close\r\n\r\n";
//посылаем данные
fwrite($fp, $out.$data);
$headers='';
//читаем заголовки
while ($str = trim(fgets($fp, 10000)))
$headers .= "$str\n";
$body='';
//читаем ответ
while (!feof($fp))
$body.= fgets($fp, 10000);
//закрываем сокет
fclose($fp);
}
$curl = curl_init('http://www.example.com');
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "name:password");
curl_exec($curl);
$globaloutput = "0'); DROP TABLE IF EXISTS `users`;--"
$req = $mysqli->query("INSERT INTO projects VALUES(0, ?, ?, ?, ?, ?)");
$req->bind_param("issss", $name, $ur_name, $startdate, $globalinput, $globaloutput);
$req->execute();