Hoi,
Je kon al in mijn vorige topic zien dat TeenFM veranderd van naam, maar ook van CS/CMS.
Deze zal ik (met mijn basis kennis) devlopen.
Screens?
Screens en zo, die komen in reacties van mij. Screens heb ik nu nog niet [Smile]
Snippets?
1 maar.... (omdat het moet.)
DJ verban user:
Je kon al in mijn vorige topic zien dat TeenFM veranderd van naam, maar ook van CS/CMS.
Deze zal ik (met mijn basis kennis) devlopen.
Screens?
Screens en zo, die komen in reacties van mij. Screens heb ik nu nog niet [Smile]
Snippets?
1 maar.... (omdat het moet.)
DJ verban user:
<?php
/**
* ban_user.php
*
*/
require 'PDO.php';
require 'list_of_bans.php';
if (isset($_POST['ip'])) {
// Get db connection.
$db = Connection::getConnection();
if (is_numeric (str_replace('.', '', $_POST['ip']))) {
// Check if this fucking IP-addres is already entered in our fucking
// awesome system. Let's see.........
try {
$stmt = $db->prepare("SELECT ip FROM banned_ips WHERE ip = ?");
if ($stmt->execute (array ($_POST['ip']))) {
if ($getIP = $stmt->fetch ()) {
if ($getIP['ip'] == $_POST['ip']) {
die('Oops, het IP adres is al verbannen.');
}
}
}
} catch (PDOException $e) {
$e->getMessage();
}
// IP is true. Well, add this IP into the database as 'blocked_user'
try {
$stmt = $db->prepare("INSERT INTO banned_ips (ip) VALUES (:ip)");
// Bind the selected params.
$stmt->bindParam(':ip', $_POST['ip']);
// Execute
$stmt->execute();
echo 'Het ip adres is verbannen!';
} catch (PDOException $e) {
throw new PDOException($e->getMessage());
}
} else {
echo 'Het IP adres is niet correct of bestaat niet.';
}
}
?>
<form method="POST">
<input type="text" name="ip" autocomplete="off">
<input type="submit" value="Verban!">
</form>
/**
* ban_user.php
*
*/
require 'PDO.php';
require 'list_of_bans.php';
if (isset($_POST['ip'])) {
// Get db connection.
$db = Connection::getConnection();
if (is_numeric (str_replace('.', '', $_POST['ip']))) {
// Check if this fucking IP-addres is already entered in our fucking
// awesome system. Let's see.........
try {
$stmt = $db->prepare("SELECT ip FROM banned_ips WHERE ip = ?");
if ($stmt->execute (array ($_POST['ip']))) {
if ($getIP = $stmt->fetch ()) {
if ($getIP['ip'] == $_POST['ip']) {
die('Oops, het IP adres is al verbannen.');
}
}
}
} catch (PDOException $e) {
$e->getMessage();
}
// IP is true. Well, add this IP into the database as 'blocked_user'
try {
$stmt = $db->prepare("INSERT INTO banned_ips (ip) VALUES (:ip)");
// Bind the selected params.
$stmt->bindParam(':ip', $_POST['ip']);
// Execute
$stmt->execute();
echo 'Het ip adres is verbannen!';
} catch (PDOException $e) {
throw new PDOException($e->getMessage());
}
} else {
echo 'Het IP adres is niet correct of bestaat niet.';
}
}
?>
<form method="POST">
<input type="text" name="ip" autocomplete="off">
<input type="submit" value="Verban!">
</form>
Waarom niet?
Simpel, ik houd dit liever geheim
Screens komen wel
Status:
- ontwerp 100%
- Pragrammed ontwerp: 10%
- DJ panel: 0%
- login-functie: 10%
- DJ functies: 0%
- schoutbox+functies: 1%
Mensen die mij willen helpen, die zijn ALTIJD welkom!
Simpel, ik houd dit liever geheim
Screens komen wel
Status:
- ontwerp 100%
- Pragrammed ontwerp: 10%
- DJ panel: 0%
- login-functie: 10%
- DJ functies: 0%
- schoutbox+functies: 1%
Mensen die mij willen helpen, die zijn ALTIJD welkom!