$path = "/etc/apache2/sites-available/$error-error.conf";
echo $path;
if($oldconf = file_get_contents ($path)){
echo 'прочитал';
}else{
echo 'не прочитал';
}
$newconf = str_replace ($delstring,$oldconf,'');
file_put_contents ($path,$newconf) or die ("Не удалось перезаписать файл");
$path = "/etc/apache2/sites-available/$error-error.conf";
if (file_exists($path)) {
echo $path;
$oldconf = file_get_contents ($path) or die ("Не удалось получить содержимое файла");
}
else {echo "Файла не существует";}
}
<?php
$error ="google";
$conn = mysqli_connect ("localhost", "admin", "***", "***");
$select_error = mysqli_query($conn, "SELECT type, url FROM *** WHERE domain = '$error'") or die (mysqli_error($conn));
while ( $arr = mysqli_fetch_array ($select_error)) {
echo $arr['url'];
echo $arr['type'];
};
?>
<?php
$error ="google";
$conn = mysqli_connect ("localhost", "admin", "***", "***");
$select_error = mysqli_query($conn, "SELECT type, url FROM *** WHERE domain = '$error'") or die (mysqli_error($conn));
while ( $arr = mysqli_fetch_array ($select_error)) {
echo $arr['url'];
echo $arr['type'];
};
?>