update CSS on nameSearch and usernameSearch. Hopefully this also gets messageSender working
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
<!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>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
@@ -8,29 +16,20 @@ body {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$servername = "localhost";
|
|
||||||
$username = "web";
|
|
||||||
$password = "Password456";
|
|
||||||
|
|
||||||
// Create connection
|
|
||||||
$conn = new mysqli($servername, $username, $password);
|
|
||||||
|
|
||||||
// Check connection
|
|
||||||
if ($conn->connect_error) {
|
|
||||||
die("Connection failed: " . $conn->connect_error);
|
|
||||||
}
|
|
||||||
|
|
||||||
$username = $_POST["name"];
|
$username = $_POST["name"];
|
||||||
$message = $_POST["message"];
|
$message = $_POST["message"];
|
||||||
|
|
||||||
$query0 = "Select max(messageID) from messages";
|
$query0 = "Select max(messageID) from messages";
|
||||||
mysqli_query($conn, $query0) or die('Error querying database.');
|
$maxID = $db_connection->query($query0);
|
||||||
$maxID = mysqli_query($conn, $query0);
|
print($maxID);
|
||||||
$maxID = $maxID + 1;
|
$maxID = $maxID + 1;
|
||||||
$query1 = "Insert into messages (messageID, sender, recipient, message, date, haveread) values({$maxID}, , {$username}, {$message}, NOW(), 'N')";
|
print($maxID);
|
||||||
mysqli_query($conn, $query1) or die('Error inserting into database.');
|
$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");
|
||||||
|
|
||||||
mysqli_close($conn);
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -4,9 +4,13 @@
|
|||||||
?>
|
?>
|
||||||
<!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" -->
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #3B5998;
|
background-color: #3B5998;
|
||||||
|
|||||||
@@ -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" -->
|
||||||
@@ -21,13 +24,6 @@ foreach($db_connection->query($query) as $row){
|
|||||||
print $row['username']." First Name:".$row['fname']." Last Name:".$row['lname']."\n";
|
print $row['username']." First Name:".$row['fname']." Last Name:".$row['lname']."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<h3>$GLOBALS</h3>';
|
|
||||||
echo "<pre>";
|
|
||||||
print_r($GLOBALS);
|
|
||||||
echo "</pre>";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user