-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (29 loc) · 723 Bytes
/
index.php
File metadata and controls
29 lines (29 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require 'vendor/autoload.php';
use profanityblocker\profanityblocker\ProfanityService;
?>
<html>
<head>
<title>Profanity Blocker PHP Sample App</title>
</head>
<body>
<h1>Profanity Blocker PHP Sample App</h1>
<form method="post">
Word: <input name="Word" type="text" /><input type="submit" value="Submit" />
</form>
<?php
if(isset ($_POST["Word"]) && !empty ($_POST["Word"])) {
$Key = "";
$Word = $_POST["Word"];
$s = new ProfanityService($Key, true, true, true);
echo "Originial Word: $Word<br><br>";
try {
echo "Parsed Word: " . $s->ParseText($Word);
}
catch (exception $e) {
echo "Server Response: " . $e->getMessage();
}
}
?>
</body>
</html>