fixes, simplifying queries
This commit is contained in:
@@ -9,6 +9,8 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="styling.css">
|
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<!--#include virtual="header.html" -->
|
||||||
|
<!--#include virtual="topNavBar.html" -->
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #3B5998;
|
background-color: #3B5998;
|
||||||
@@ -16,17 +18,8 @@ body {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
$query = "Insert into messages (sender, recipient, message, date, haveread) values('".$_SESSION["loggedInUser"]."', '".$_POST["name"]."', '".$_POST["message"]."', NOW(), 'N')";
|
||||||
$username = $_POST["name"];
|
$db_connection->query($query)
|
||||||
$message = $_POST["message"];
|
|
||||||
|
|
||||||
$query0 = "Select max(messageID) from messages";
|
|
||||||
$maxID = $db_connection->query($query0);
|
|
||||||
print($maxID);
|
|
||||||
$maxID = $maxID + 1;
|
|
||||||
print($maxID);
|
|
||||||
$query1 = "Insert into messages (messageID, sender, recipient, message, date, haveread) values('".$maxID."', '".$_SESSION["loggedInUser"]."', '".$_POST["name"]."', '".$_POST["message"]."', NOW(), 'N')";
|
|
||||||
$db_connection->query($query1)
|
|
||||||
|
|
||||||
print("Message Has been sent");
|
print("Message Has been sent");
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
?>
|
?>
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!--#include virtual="header.html" -->
|
<!--#include virtual="header.html" -->
|
||||||
<!--#include virtual="topNavBar.html" -->
|
<!--#include virtual="topNavBar.html" -->
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<!DOCTYPE html>
|
<?php
|
||||||
|
require 'common.php';
|
||||||
|
require 'loginRequired.php';
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<!--#include virtual="header.html" -->
|
||||||
|
<!--#include virtual="topNavBar.html" -->
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #3B5998;
|
background-color: #3B5998;
|
||||||
|
|||||||
Reference in New Issue
Block a user