Commit 6059c11c by mhasan

commented

parent 3f09b60d
Showing with 10 additions and 4 deletions
...@@ -33,24 +33,24 @@ ...@@ -33,24 +33,24 @@
</nav> </nav>
<h2 style="text-align: center; margin-top:80px"> Registration</h2> <h2 style="text-align: center; margin-top:80px"> Registration</h2>
<!-- On submit, the script register.php is called, which adds a new entry for the user in the database and creates a table (with his userName) for his tasks.-->
<div class='form'> <div class='form'>
<form class = 'form-group' style='text-align:center; margin-top: 35px' action="./php/register.php" method="post"> <!--On every key press call the matchPass function from the passwordMatch script --> <form class = 'form-group' style='text-align:center; margin-top: 35px' action="./php/register.php" method="post"> <!--On every key press call the matchPass function from the passwordMatch script -->
<label class="form-control-label"> User Name :</label> <span id="suggest"> </span> <label class="form-control-label"> User Name :</label> <span id="suggest"> </span>
<input type="text" name="userName" id = "userName" onkeyup= "searchUser()"> &nbsp;&nbsp;&nbsp; <br> <input type="text" name="userName" id = "userName" onkeyup= "searchUser()"> &nbsp;&nbsp;&nbsp; <br> <!-- on every key press, it uses the search user function in the script to see if username is availble. -->
<label class="form-control-label"> Email :</label> <label class="form-control-label"> Email :</label>
<input type="email" name="email" required> <br> <input type="email" name="email" required> <br>
<label class="form-control-label"> Password :</label> <label class="form-control-label"> Password :</label>
<input type="password" name="pass1" id="pass1" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match1"> </span> <br> <input type="password" name="pass1" id="pass1" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match1"> </span> <br> <!-- On every key press it checks the 2 password fields for matches. -->
<label class="form-control-label"> Confirm Password :</label> <label class="form-control-label"> Confirm Password :</label>
<input type="password" name="pass2" id="pass2" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match2"> </span> <br> <input type="password" name="pass2" id="pass2" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match2"> </span> <br>
<br><br><span id="match"> </span> <br><br><span id="match"> </span>
<br> <input class="btn btn-success" type="submit" name="submit" value="submit" id = "submit" disabled> <br> <input class="btn btn-success" type="submit" name="submit" value="submit" id = "submit" disabled> <!-- If username is available and both passwords match, the submit button is enabled. -->
</form> </form>
</div> </div>
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
/* /*
* View page. * View page.
* Twig is loaded. * Twig is loaded.
* session is started.
*
* if userName is present (meaning user is logged in), it executes the script serveData which returns a $taskArray global variable containing task objects.
* Then this task Array rendered with twig for the view.html where the appropriate values are input into the templates.
*
* else it renders view.html with tasks as null, which urges the user to log in.
*/ */
session_start(); session_start();
require 'Twig/lib/Twig/Autoloader.php'; require 'Twig/lib/Twig/Autoloader.php';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment