Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
<?php
2
//Dc-shout2.0 (c)devilcoderz 2004
3
include "header.php";
4
if (!session_is_registered(username)) {
5
echo "Your not loged in!" ;
6
}
7
else
8
{
9
include "config.php";
10
?>
11
<center><b>Word fillter</b></center>
12
<br>
13
<br>
14
<?php
15
if ($action=="")
16
{
17
print "Words blocked at the moment are:<br>";
18
$gwords= mysql_query("select * from dc_word");
19
while ($w=mysql_fetch_array($gwords))
20
{
21
print "$w[word] <a href=\"word.php?action=del&id=$w[id]\">Delete</a>";
22
}
23
echo"<center><b>Add new word</b></center><br>";
24
?>
25
<form action="word.php?action=add" method="POST">
26
<input type="text" NAME="word" size="11"><br>
27
<input type="submit" value="Submit" name="submit">
28
</form>
29
<?
30
 
31
}
32
//Delte word
33
if ($action=="del")
34
{
35
$sql = "DELETE FROM dc_word WHERE id='$_GET[id]'"or die ('No Such Word!');
36
$result = mysql_query($sql);
37
echo "The word was deleted form the fillter";
38
}
39
//addword O.o
40
if ($action=="add")
41
{
42
if (!$_POST['word'])
43
{
44
echo "You did not enter a word :(";
45
}
46
else
47
{
48
$result = MYSQL_QUERY("INSERT INTO dc_word (id, word)". "VALUES ('NULL', '$_POST[word]')"); // inssert done
49
echo "Badword  added :)";
50
}
51
}
52
}
53
include "footer.php";
54
?>
55
 
56
 
57
 
58
 
59
 
60