fixes, simplifying queries
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--#include virtual="header.html" -->
|
||||
<!--#include virtual="topNavBar.html" -->
|
||||
<style>
|
||||
body {
|
||||
background-color: #3B5998;
|
||||
@@ -16,17 +18,8 @@ body {
|
||||
</style>
|
||||
|
||||
<?php
|
||||
|
||||
$username = $_POST["name"];
|
||||
$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)
|
||||
$query = "Insert into messages (sender, recipient, message, date, haveread) values('".$_SESSION["loggedInUser"]."', '".$_POST["name"]."', '".$_POST["message"]."', NOW(), 'N')";
|
||||
$db_connection->query($query)
|
||||
|
||||
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">
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--#include virtual="header.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>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="styling.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--#include virtual="header.html" -->
|
||||
<!--#include virtual="topNavBar.html" -->
|
||||
<style>
|
||||
body {
|
||||
background-color: #3B5998;
|
||||
|
||||
Reference in New Issue
Block a user