Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function print_chat($mysqli, $query)
- {
- if ($stmt = $mysqli->prepare($query))
- {
- $stmt->execute();
- $stmt->bind_result($id, $username, $msg, $timestamp);
- while ($stmt->fetch())
- {
- printf ("<span>%s</span> <b>%s</b>: %s\n\r", $timestamp, $username, htmlspecialchars($msg));
- print ("<br />");
- }
- $stmt->close();
- }
- }
- function post_msg($mysqli, $query)
- {
- $stmt = $mysqli->prepare($query);
- $stmt->execute();
- }
- function users($mysqli, $query)
- {
- if ($result = $mysqli->query($query)) {
- while ($row = $result->fetch_row()) {
- if ($row[0] == $mysqli->real_escape_string($_POST['username']))
- {
- if ($row[1] == sha1($mysqli->real_escape_string($_POST['password'])))
- {
- $_SESSION['login'] = $row[0];
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement