Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-Chat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SST
PHP-Chat
Commits
6415e076
Commit
6415e076
authored
Jul 18, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fehler beim senden der nachricht behoben
parent
c07f0487
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
12 deletions
+21
-12
config.php
config.php
+1
-1
send.php
send.php
+20
-11
No files found.
config.php
View file @
6415e076
...
...
@@ -31,7 +31,7 @@ function ChatNachricht($text, $admin, $userchange ){
}
mysql_query
(
"INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('
{
$_SESSION
[
'chatuserid'
]
}
', '
$text
', '
$userchange
', '
$admin
', '"
.
time
()
.
"', '
$UserID
')"
);
//echo "INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')";
mysql_query
(
"UPDATE user SET chat = '"
.
mysql_insert_id
()
.
"' WHERE id = '
{
$_SESSION
[
'chatuserid'
]
}
'"
);
//
mysql_query("UPDATE user SET chat = '".mysql_insert_id()."' WHERE id = '{$_SESSION['chatuserid']}'");
if
(
preg_match
(
"/James/i"
,
$text
))
{
$time
=
time
();
...
...
send.php
View file @
6415e076
...
...
@@ -3,7 +3,7 @@ $result = mysql_query("SELECT * FROM user WHERE id = '{$_SESSION['chatuserid']}'
$users
=
mysql_fetch_array
(
$result
);
var_dump
(
$_POST
);
if
(
!
isset
(
$_SESSION
[
'chatuserid'
])
OR
$users
[
'online'
]
==
0
)
echo
"
Erst einloggen...
"
;
echo
"
Fehler
"
;
else
{
if
(
isset
(
$_POST
[
'chatok'
]))
{
if
(
$_POST
[
'text'
]
!=
""
)
{
...
...
@@ -14,27 +14,36 @@ else{
$id
=
UsernametoID
(
substr
(
$_POST
[
'text'
],
3
,
$end
-
3
));
}
else
$id
=
0
;
$nachricht
=
nachrichtausgabe
(
0
,
0
,
$id
,
$users
[
'name'
],
time
(),
ChatNachricht
(
$_POST
[
'text'
],
0
,
0
),
"0"
);
echo
"<script>parent.chat.add('
$nachricht
');</script>"
;
ChatNachricht
(
$_POST
[
'text'
],
0
,
0
);
echo
"OK"
;
//$nachricht = nachrichtausgabe(0, 0, $id, $users['name'], time(), ChatNachricht($_POST['text'], 0, 0),"0");
//echo "<script>parent.chat.add('$nachricht');</script>";
}
}
if
(
isset
(
$_POST
[
'modok'
])
AND
$users
[
'admin'
]
>=
1
)
{
else
if
(
isset
(
$_POST
[
'modok'
])
AND
$users
[
'admin'
]
>=
1
)
{
if
(
$_POST
[
'text'
]
!=
""
)
{
$nachricht
=
nachrichtausgabe
(
0
,
1
,
0
,
$users
[
'name'
],
time
(),
ChatNachricht
(
$_POST
[
'text'
],
1
,
0
),
""
);
echo
"<script>parent.chat.add('
$nachricht
');</script>"
;
ChatNachricht
(
$_POST
[
'text'
],
1
,
0
);
echo
"OK"
;
//$nachricht = nachrichtausgabe(0, 1, 0, $users['name'], time(), ChatNachricht($_POST['text'], 1, 0),"");
//echo "<script>parent.chat.add('$nachricht');</script>";
}
}
if
(
isset
(
$_POST
[
'adminok'
])
AND
$users
[
'admin'
]
>=
2
)
{
else
if
(
isset
(
$_POST
[
'adminok'
])
AND
$users
[
'admin'
]
>=
2
)
{
if
(
$_POST
[
'text'
]
!=
""
)
{
$nachricht
=
nachrichtausgabe
(
0
,
2
,
0
,
$users
[
'name'
],
time
(),
ChatNachricht
(
$_POST
[
'text'
],
2
,
0
),
""
);
echo
"<script>parent.chat.add('
$nachricht
');</script>"
;
ChatNachricht
(
$_POST
[
'text'
],
2
,
0
);
echo
"OK"
;
//$nachricht = nachrichtausgabe(0, 2, 0, $users['name'], time(), ChatNachricht($_POST['text'], 2, 0),"");
//echo "<script>parent.chat.add('$nachricht');</script>";
}
}
if
(
isset
(
$_POST
[
'specialok'
])
AND
$users
[
'admin'
]
>=
3
)
{
else
{
echo
"Fehler"
;
}
/*if(isset($_POST['specialok']) AND $users['admin'] >= 3) {
if($_POST['text'] != "") {
$nachricht = nachrichtausgabe(0, 3, 0, $users['name'], time(), ChatNachricht($_POST['text'], 3, 0),"");
echo "<script>parent.chat.add('$nachricht');</script>";
}
}
}
*/
}
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment