Added new php files
This commit is contained in:
27
functions.php
Normal file
27
functions.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
$dbhost = 'localhost';
|
||||||
|
$dbname = 'f8lbank';
|
||||||
|
$dbuser = 'admin';
|
||||||
|
$dbpassword = 'password';
|
||||||
|
$appname = 'F8L Bank';
|
||||||
|
|
||||||
|
$connection = new mysqli($dbhost, $dbuser, $dbpassword, $dbname);
|
||||||
|
if ($connection->connect_error) die ($connection->connect_error);
|
||||||
|
|
||||||
|
function queryMysql($query){
|
||||||
|
global $connection;
|
||||||
|
$result = $connection->query($query);
|
||||||
|
if (!$result) die ($connection->error);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroySession(){
|
||||||
|
$_SERVER = array();
|
||||||
|
|
||||||
|
if (session_id() != "" || isset($_COOKIE[session_name()]))
|
||||||
|
setcookie (session_name (), '', time() - 2592000, '/');
|
||||||
|
|
||||||
|
session_destroy();
|
||||||
|
}
|
||||||
|
?>
|
||||||
16
header.php
16
header.php
@@ -1,7 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
echo <<<_END
|
echo <<<_END
|
||||||
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
_END;
|
||||||
|
|
||||||
|
require_once 'functions.php';
|
||||||
|
|
||||||
|
$userstr = " (Guest)";
|
||||||
|
|
||||||
|
if (isset($_SESSION['user'])){
|
||||||
|
$user = $_SESSION['user'];
|
||||||
|
$loggedin = TRUE;
|
||||||
|
$userstr = " ('$user')";
|
||||||
|
} else {
|
||||||
|
$loggedin = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo <<<_END
|
||||||
<title>F8L Online Banking</title>
|
<title>F8L Online Banking</title>
|
||||||
<link rel='stylesheet' type='text/css' href='style.css'>
|
<link rel='stylesheet' type='text/css' href='style.css'>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ require_once 'header.php';
|
|||||||
|
|
||||||
|
|
||||||
echo <<<_END
|
echo <<<_END
|
||||||
|
<div>HELLO WORLD!!</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
_END;
|
_END;
|
||||||
|
|||||||
14
styles.css
14
styles.css
@@ -0,0 +1,14 @@
|
|||||||
|
* {
|
||||||
|
font-family:verdana,sans-serif;
|
||||||
|
font-size :14pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
body{
|
||||||
|
width: 700px;
|
||||||
|
margin: 20px auto;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
html{
|
||||||
|
background-color: aqua;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user