#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
# nisplus Use NIS+ (NIS version 3)
# nis Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#
# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis
passwd: files winbind
shadow: files winbind
group: files winbind
#hosts: db files nisplus nis dns
hosts: files dns
# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files
bootparams: nisplus [NOTFOUND=return] files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files
netgroup: files
publickey: nisplus
automount: files
aliases: files nisplus
print_r($IP);
print_r($NamePC);
print_r($pass);
print_r($passadm);
$sql = "INSERT INTO vls VALUES (INET_NTOA('".$IP ."'), '".$NamePC."', '".$pass."', '".$passadm."')";
$query = mysqli_query ($db_server, $sql);
echo $sql;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<?php
require_once 'login.php';
$db_server = mysqli_connect($db_hostname, $db_username, $db_password);
if (!$db_server) die("Что-то пошло не так MySQL: " . mysqli_error());
mysqli_query($db_server,"SET NAMES utf8");
mysqli_select_db($db_server, $db_database)
or die ("Что-то пошло не так: " . mysqli_error());
include 'script.js';
$query = "SELECT id,ip_addr,namepc,pass, passadm FROM vlc ORDER BY ip_addr ";
$result = mysqli_query($db_server, $query);
echo '<table border="1">';
echo '<thead>';
echo '</thead>';
echo '<tbody>';
?><form method="POST" id="forms" onsubmit="call(); return false" autocomplete="off"><?php
while($data = mysqli_fetch_array($result))
{
echo '<tr>';
echo '<td>' . long2ip ($data['ip_addr']) . '</td>';
echo '<td>' . $data['namepc'] . '</td>';
echo '<td>' . $data['pass'] . '</td>';
echo '<td>' . $data['passadm'] . '</td>';
echo "<td width='10px'><input type='checkbox' name='check[]' value=". $data['id'] ."></td>";
echo '</tr>';
}
?></form><?php
?>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$('#forms input:checkbox:checked').attr('checked', false);
});
function call() {
var msg = $('#forms').serialize();
$.ajax({
type: 'POST',
url: 'delete.php',
data: msg,
success: function(data) {
document.location.reload();
},
error: function(xhr, str){
alert('Возникла ошибка: ' + xhr.responseCode);
}
});
}
</script>
type="text/css">
/* Кнопка отправки формы */
.cnopka {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
background-image: -ms-linear-gradient(top, #3498db, #2980b9);
background-image: -o-linear-gradient(top, #3498db, #2980b9);
background-image: linear-gradient(to bottom, #3498db, #2980b9);
-webkit-border-radius: 0;
-moz-border-radius: 0;
border-radius: 0px;
font-family: Arial;
color: #ffffff;
font-size: 10px;
padding: 4px 17px 5px 18px;
border: solid #101e26 1px;
text-decoration: none;
position: fixed;
top: 522px;
}
/*Шапка для формы*/
/*Прокрутчик формы*/
#scroll {
position:relative;
width:462px;
height:480px;
overflow:auto
}
#scrollcontent {
position:absolute;
width:375px;
z-index:200
}
#scrollbar {
float:right;
position:relative;
display:none;
width:15px;
height:200px;
z-index:100;
background:url(images/scroll-bg.gif)
}
.scroller {
position:absolute;
top:0;
width:15px;
cursor:pointer;
background-color:#ccc;
background-image:url(images/scroll-arrows.gif);
background-position:50% 50%;
background-repeat:no-repeat
}
.buttonclick {
background-color:#bbb
}
<?php
require_once 'login.php';
$db_server = mysqli_connect($db_hostname, $db_username, $db_password);
if (!$db_server) { echo "Текст ошибки error: " . mysqli_connect_error() . PHP_EOL; exit; }
mysqli_select_db($db_server, $db_database);
foreach ($_POST['check'] as $item)
{
$query = "DELETE FROM vlc WHERE id = $item";
$result = mysqli_query($db_server, $query);
}
?>
mysqli_select_db($db_server, $db_database);
require_once 'login.php';
$db_server = mysqli_connect($db_hostname, $db_username, $db_password);
mysqli_select_db($db_server, $db_database);