Skip to content

Commit 05d7427

Browse files
committed
Added some comments and created a new branch
1 parent b55a6c6 commit 05d7427

File tree

7 files changed

+22
-8
lines changed

7 files changed

+22
-8
lines changed

forum/connect.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
//Connecting to the Database
34
$database = array();
45
$database['host'] = "localhost";
56
$database['port'] = "3306";

forum/forum_functions.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
2-
2+
3+
//Function to check for invalid characters in the Username
34
function checkInvalidCharacters($text) {
45

56
return(bool) preg_match("/[^\w-.]/" , $text );
67
}
78

9+
//Function to encrypt the users Password
810
function encrypt_pswd($input , $rounds = 9 ){
911

1012
$salt = "";

forum/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- Login page without Fancy Frontend -->
2+
13
<!DOCTYPE html>
24

35
<html lang="en-US">

forum/login.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
2+
//Login Functions
3+
34
$username = $_POST['username'];
45
$password = $_POST['password'];
56

forum/register.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- Registeration page without Fancy Frontend -->
12
<!DOCTYPE html>
23

34
<html lang="en-US">
@@ -6,10 +7,12 @@
67
<meta http-equiv="X-UA-Compatible" content="IE=edge">
78
<title>CODEX FORUM</title>
89
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<!-- House Keeping Elements -->
911
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
1012
<script src="main.js"></script>
1113
</head>
1214
<body>
15+
<!-- Sending register_parse the User's data by passing method = POST -->
1316
<form action = "register_parse.php" method = "POST">
1417
Enter a Username : <input type = "text" name = "username" placeholder="Enter a Username"><br><br>
1518
Enter a Password &nbsp;: <input type="password" name = "password" placeholder="Enter a Password"><br><br>

forum/register2.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- This is the register page with fancy frontend -->
2+
13
<!DOCTYPE html>
24
<html lang="en" >
35

@@ -11,12 +13,12 @@
1113
<style>
1214
/* This is inline styling*/
1315
body {
14-
font-family: "Open Sans", sans-serif;
15-
height: 100vh;
16-
background: url("https://scontent-bom1-1.xx.fbcdn.net/v/t1.0-9/14720459_1037919169668229_6982952498177798721_n.jpg?oh=852060ef345fbdcb6c6787149071986c&oe=5B45206C")
17-
50% fixed;
18-
background-size: cover;
19-
}
16+
font-family: "Open Sans", sans-serif;
17+
height: 100vh;
18+
background: url("https://scontent-bom1-1.xx.fbcdn.net/v/t1.0-9/14720459_1037919169668229_6982952498177798721_n.jpg?oh=852060ef345fbdcb6c6787149071986c&oe=5B45206C")
19+
50% fixed;
20+
background-size: cover;
21+
}
2022
2123
@keyframes spinner {
2224
0% {

forum/register_parse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@
1111
/* echo "Registeration Details : ";
1212
echo "Username : " . $username . "<br/><br/> Password : " . $password; */
1313

14+
//CHecking If the User forgot to enter the Username or Password
1415
if ( $username == "" || $password == ""){
1516
echo "Please fill in all the details <br/> Please check if you forgot to enter data in any of the fields <br/>";
1617
}
1718

19+
//Checking for invalid Username or short Password
20+
//The account will be fed to the database only if the above two conditions are satisfied.
1821
else {
1922
if( checkInvalidCharacters($username) )
2023
echo "Username can only contain <br/><br/><ul><li> A to Z </li><li> a to z </li><li> 0 to 9 </li><li> . and _ </li></ul>";

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy