Web Projects 2 (ICT518)
DIPET 2 in ICT - ICTT
Semester: Resit
Level: 500
Year: 2016
1
SCHOOL: H.T.T.T.C DEPARTEMENT: CS LECTURER(S): Dr. DADA Jean-Pierre
COURSE CODE: ICT518 COURSE TITLE: Web PROJECTS II OPTION: ICT
DATE: MAY …..
th
, 2016 HALL: …. TIME: 1:30 NATURE: RESIT
Instructions: Answer all questions below.
Documents 1 and 2 (see pages 2 and 3) represent part of an entire web project. By e
carefully using those documents, answer the following questions.
1. Give the name of this database
2. Give the name of a table
3. List two columns of this table
4. Which document represents the index file? Document 1 or document 2?
5. Give the name of the *.php file representing document 2 and justify your answer by writing the
instructions that helped you.
6. Explain the following instructions:
6.1 mysql_connect("localhost","root","") ;
6.2 mysql_select_db("ICT500") or die ('ERREUR '.mysql_error());
6.3 if(isset($_POST["submit"]))
6.4 if(!empty($_POST['login']) && !empty($_POST['password']))
6.5 $login=$_POST["login"];
6.6 $req2= "select loginadm,pwdadm from administrations where loginadm ='$login' and pwdadm='$password'";
6.7 $num2=mysql_num_rows($mg2);
7. The database related to these documents contains home pages related to “teachers”, “students” and
“administrations”. Which home page represents the document 2?
8. Give the number of menus document 2 has.
9. Fill the following table by using document 2:
SN Menus Submenus Number of submenus
1 Deconnexion
2
CA Marks
2
3
4
REPUBLIC OF CAMEROON
Peace – Work – Fatherland
***********
THE UNIVERSITY OF BAMENDA
***********
HIGHER TECHNICAL TEACHER TRAINING
COLLEGE (H.T.T.T.C.) BAMBILI
***********
DIRECTORATE OF STUDIES
**********
P.O.BOX 39 BAMBILI
REPUBLIQUE DU CAMEROON
Paix – Travail - Patrie
***********
UNIVERSITE DE BUEA
***********
ECOLE NORMALE SUPERIEURE D’ENSEIGNEMENT
TECHNIQUE
***********
DIRECTION DES ETUDES
**********
Tél: 33 05 10 69
www.schoolfaqs.net
2
Document 1
<?php
@session_start();
mysql_connect("localhost","root","") ;
mysql_select_db("ICT500") or die ('ERREUR '.mysql_error());
if(isset($_POST["submit"]))
{
if(!empty($_POST['login']) && !empty($_POST['password']))
{
$login=$_POST["login"];
$password=$_POST["password"];
$req2= "select loginadm,pwdadm from administrations where loginadm ='$login' and pwdadm='$password'";
$mg2= mysql_query($req2);
$num2=mysql_num_rows($mg2);
if($num2>0)
{
$_SESSION['login']=$_POST['login'];
$_SESSION['password']=$_POST['password'];
echo '<meta http-equiv="refresh" content="0;URL=HomePage_adm.php"> ';
} }mysql_close();
}?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>page connexion</title>
<link rel="stylesheet" type="text/css" href="claire.css" media="screen" />
</head><body><br/><br/> <div class="header"> </div> <br/>
<div class="contenu">
<form class="formulaire" method="post" action="index.php">
<table class="tableau_form" align="center">
<tr>
<th align="right"><label for="login" > Login : </label></th>
<th align="left"><input type="text" name="login" /></th>
</tr> <tr>
<th align="right"><label for="password" > Mot de passe : </label></th>
<th align="left" > <input type="password" name="password" /></th>
</tr> <tr>
<th colspan="2">
<input type="submit" name="submit" value="valider" />
<input type="reset" name="submit" value="annuler" />
</th> </tr>
</table> </form>
<br/><br/>
<a href="envoi_password.php">Mot de passe oublié? </a> <br/><br/>
<a href="compte_etudiant.php"> Créer un compte etudiant </a>
</div></body></html>
www.schoolfaqs.net
3
Document 2
<?php
@session_start();
if( !empty($_SESSION['login']))
{
$login=$_SESSION['login'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Administrator Home Page</title>
<link rel="stylesheet" type="text/css" href="menu.css" media="screen" />
<link rel="stylesheet" type="text/css" href="claire.css" media="screen" />
</head><body> <br/> <br/> <div class="header"> </div>
<div id="menu">
<ul class="mon_menu">
<li><a href="HomePage_adm.php"><span class="l"></span><span class="r"></span><span
class="t">Home Page</span></a></li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Filling</span></a>
<ul>
<li><a href="Fill_CA.php">CA Marks</a></li>
<li><a href="Fill_EXAM.php">Exam Marks</a></li>
</ul>
</li>
<li><a href="#"><span class="l"></span><span class="r"></span><span class="t">Printings</span></a>
<ul>
<li><a href="Print_marks.php">CA Marks </a></li>
<li><a href="Print_semester.php">Semester Marks </a></li>
<li><a href="Print_annual.php">Annual Results</a></li>
<li><a href="Print1_ReportCards.php">Report Cards</a></li>
</ul>
</li>
<li><a href="index.php"><span class="l"></span><span class="r"></span><span
class="t">Deconnexion</span></a></li>
</ul>
</div>
<div class="contenu">
<?php echo "<big><big><big><big><b>Good day Dr. $login </big></big></big></big></b>";?>
<br/>
<?php echo "<big><big><b>Good day Mr. Administrator</big></big></b>";?>
<br/>
<p class="image_accueil"> </p>
</div>
</body>
</html>
<?php
}
?>
www.schoolfaqs.net