foreach ($_POST as $k => $v)
{
if (preg_match(/^ProtectMean_(\d+)$/, $k, $r))
{
$update= $GLOBALS['pdo']->prepare("UPDATE protect_means SET nameOfMeans=:value1 WHERE ID=:ID");
$update->bindParam(':value1', $v);
$update->bindParam(':ID', $r[1]);
$update->execute();
}
} $db_res1 = $db->Query("SELECT * FROM db_news WHERE cat_id = '$catid' ORDER BY id DESC");//
if($db_res1->NumRows() > 0){
while($news = $db_res1->FetchArray()){
$textfull = $news["news"];
$db_res2 = $db->Query("SELECT * FROM db_news_img WHERE news_id = '$news[id]' ORDER BY id DESC");//
if($db_res2->NumRows() > 0){
while($img = $db_res2->FetchArray()){ function clickBanner(c, b) {
url_str = b + "/include/get_info.php";
$.ajax({
method: "GET",
url: url_str,
data: { 'type': "banner", 'id': c },
success: function(d) {}
})
}if (preg_match("#</form>[\s\r\n]*<br/><br/>[\s\r\n]*(.+?)</center>#s", $data, $regs))
{
foreach(explode("<br>", $regs[1]) as $v)
{
if (preg_match("#^([^:]+):\s*(.+)$#", strip_tags($v), $regs2))
{
$arr[$regs2[1]] = $regs2[2];
}
}
}
echo($arr['Name']." = ".$arr['Status']); // Moscow = Yes curl_setopt($ch, CURLOPT_HEADER, true) при curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) HTTP-header возвращается в теле ответа $html = curl_exec($ch). Вот оттуда его и доставайте через$html = curl_exec($ch);
if ($html !== false)
{
$ch_info = curl_getinfo($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$header = substr($html, 0, $ch_info['header_size']);
$html = substr($html, $ch_info['header_size']);
} <?php
$host = 'localhost';
$database = 'db';
$user = 'root';
$password = '';
$link = mysqli_connect($host, $user, $password, $database) or die("Ошибка: ".mysqli_error($link));
$result = mysqli_query($link, 'SELECT name FROM class_testregion') or die("Ошибка: ".mysqli_error($link));
$i = 1;
while ($row = mysqli_fetch_assoc($result)) {
echo("<a href='".$row['name']."'>hello".($i++)."</a><br>\n");
}
?>