old work
This commit is contained in:
9
addNetwork.php
Normal file → Executable file
9
addNetwork.php
Normal file → Executable file
@ -4,8 +4,10 @@ $gateway = ip2long(filter_input(INPUT_POST, "gateway", FILTER_VALIDATE_IP));
|
||||
$mask = ip2long(filter_input(INPUT_POST, "mask", FILTER_VALIDATE_IP));
|
||||
$siteId = filter_input(INPUT_POST, "siteId", FILTER_VALIDATE_INT);
|
||||
if (!($name && $gateway && $mask && $siteId)) {
|
||||
header("Location: 400.php");
|
||||
exit;
|
||||
/*header("Location: 400.php");
|
||||
exit;*/
|
||||
include "400.php";
|
||||
die();
|
||||
}
|
||||
$networkAddress = $gateway & $mask;
|
||||
include "connect.php";
|
||||
@ -15,8 +17,7 @@ try {
|
||||
$networkId = $db->lastInsertId();
|
||||
$insert = $db->exec("INSERT INTO Hosts(IPAddress, NetworkId, Comments) VALUES($gateway, $networkId, 'Passerelle')");
|
||||
header("Location: network.php?networkId=$networkId");
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
header("Location: 500.php");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user