-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplib.php
More file actions
53 lines (45 loc) · 1.36 KB
/
Copy pathcomplib.php
File metadata and controls
53 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>CompLib Login page</title>
<link rel="stylesheet" href="css/login.css">
<style>
body{
background-image: url('images/login.png');
background-repeat: repeat;
}
</style>
</head>
<body>
<div class="title">
<h1>Welcome to CompLib </h1>
<h2>Student Exam Number: B163919</h2>
</div>
<form class="box" action="indexp.php" method="post">
<h1>Login</h1>
<input type="forename" name="fn" placeholder="Forename" pattern="[A-Za-z ]{1,32}" rquired>
<input type="surname" name="sn" placeholder="Surname" pattern="[A-Za-z ]{1,32}" required>
<input type="submit" value="Login">
</form>
<?php
require_once 'login.php';
$db_server = mysql_connect( $db_hostname, $db_username, $db_password );
if ( !$db_server )die( "Unable to connect to database: " . mysql_error() );
mysql_select_db( $db_database, $db_server )or die( "Unable to select database: " . mysql_error() );
$query = "select * from Manufacturers";
$result = mysql_query( $query );
if ( !$result )die( "unable to process query: " . mysql_error() );
$rows = mysql_num_rows( $result );
$mask = 0;
mysql_close( $db_server );
for ( $j = 0; $j < $rows; ++$j ) {
$mask = ( 2 * $mask ) + 1;
}
$_SESSION[ 'supmask' ] = $mask;
?>
</body>
</html>