old work
This commit is contained in:
Regular → Executable
Regular → Executable
Regular → Executable
+5
-4
@@ -4,8 +4,10 @@ $gateway = ip2long(filter_input(INPUT_POST, "gateway", FILTER_VALIDATE_IP));
|
|||||||
$mask = ip2long(filter_input(INPUT_POST, "mask", FILTER_VALIDATE_IP));
|
$mask = ip2long(filter_input(INPUT_POST, "mask", FILTER_VALIDATE_IP));
|
||||||
$siteId = filter_input(INPUT_POST, "siteId", FILTER_VALIDATE_INT);
|
$siteId = filter_input(INPUT_POST, "siteId", FILTER_VALIDATE_INT);
|
||||||
if (!($name && $gateway && $mask && $siteId)) {
|
if (!($name && $gateway && $mask && $siteId)) {
|
||||||
header("Location: 400.php");
|
/*header("Location: 400.php");
|
||||||
exit;
|
exit;*/
|
||||||
|
include "400.php";
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
$networkAddress = $gateway & $mask;
|
$networkAddress = $gateway & $mask;
|
||||||
include "connect.php";
|
include "connect.php";
|
||||||
@@ -15,8 +17,7 @@ try {
|
|||||||
$networkId = $db->lastInsertId();
|
$networkId = $db->lastInsertId();
|
||||||
$insert = $db->exec("INSERT INTO Hosts(IPAddress, NetworkId, Comments) VALUES($gateway, $networkId, 'Passerelle')");
|
$insert = $db->exec("INSERT INTO Hosts(IPAddress, NetworkId, Comments) VALUES($gateway, $networkId, 'Passerelle')");
|
||||||
header("Location: network.php?networkId=$networkId");
|
header("Location: network.php?networkId=$networkId");
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
header("Location: 500.php");
|
header("Location: 500.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
Regular → Executable
+4
-2
@@ -1,8 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
$siteName = filter_input(INPUT_POST, "siteName", FILTER_SANITIZE_STRING);
|
$siteName = filter_input(INPUT_POST, "siteName", FILTER_SANITIZE_STRING);
|
||||||
if (!$siteName) {
|
if (!$siteName) {
|
||||||
header("Location: 400.php");
|
/*header("Location: 400.php");
|
||||||
exit;
|
exit;*/
|
||||||
|
include "400.php";
|
||||||
|
die();
|
||||||
}
|
}
|
||||||
include "connect.php";
|
include "connect.php";
|
||||||
try {
|
try {
|
||||||
|
|||||||
Regular → Executable
Regular → Executable
+3
-3
@@ -4,7 +4,7 @@ try {
|
|||||||
$db = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME", $DB_USER, $DB_PASSWORD);
|
$db = new PDO("mysql:host=$DB_HOST;dbname=$DB_NAME", $DB_USER, $DB_PASSWORD);
|
||||||
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
|
||||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
} catch(Exception $e) {
|
} catch (Exception $e) {
|
||||||
header("Location: 500.php");
|
//header("Location: 500.php");
|
||||||
|
die($e);
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Reference in New Issue
Block a user