How To Develop CS619 Web Application Project (Part-2)

How to Build Final Project of CS619 Computer Science all phases Help Available in this section.
Post Reply
User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 177
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

How To Develop CS619 Web Application Project (Part-2)

Post by ALI RAZA » Mon Sep 24, 2018 6:23 am

Welcome In Second Part Development of CS619 Project Basic App.
In First Part We Created a folder app and Inserted file index in app Folder Now We See the Complete Structure of our app and files in app folder hierarchy.

Image

As you can see in above figure that the hierarchy of our app folder App folder contains 2 directories. Classes and Style and 5 other Files Names Index, login, logout, members, register.
The Classes Directory Contains 2 Files with Name connection, and session. The Directory Style contains 4 files name footer, header.
First of All you should Make These Files with as Show in the Structure and We Discuss One By One Them.
So Let’s Start From the Index.php Real Code for Our App

Image

As you Learned Html in CS101 from Dr Altaf Khan My Favorite Teacher. We are just implementing the CS101 Ideas We Learned In CS101 Lectures and Assignments About How to Create Table In Html So In above Index File We Only Created a Table after Body Tag Width 80 % and some other Attributes also Included in Table like Align =center and border .The New Thing in this above File is How We Included
Files That are Placed in Style Folder So We Start Php tag
<?php include(‘./style/header.php’); ?>
So We Started With <?php This is Initial Tag of Php language and ?> is Ending Tag of Php The Code of Php Should be in These Tags otherwise Server Never Executes The Php code
The Second thing is Function include. This Function includes the code of header.php that exists in Style Folder column of our index .php table.
The Important Thing in This Code is how we defined the path of file. First we written the path in single quotes and started from dot like ./style/header.php. The Dot is very much necessary why because it defines the root of our application our root directory is app so from app directory reference it includes file. if we not use dot in start it works fine for when we including Files From sub directories but if we are in some sub directory and without using dot include file form main directory this will never works and Gives error so the dot is very important concept of including files in Php code . You can add any file form any Directory by using dot reference.

See The Header File code.
Image

As you can see we not included html , head and Body Tags in header . We just included table as Menu of our application . Because in index.php file where include this file a table will be insterted their so no need to write html head body tags in include able file . Index file already contains the html , head and Body tags .
Now See Below footer File which also in code with out html head body tags Reason is as i described above
See The Footer File code.
Image

you Can Change The Footer As you Like but Header Should be Same Code As in Picture.

So in This Part We Dicussed 3 files Index.php , header.php and footer.php . The Files left.php and right.php for widgets we can add widgets of our own choice but Now these files are empty so skip these files code but must include them either they empty ok .
in next Part We Will discuses Registration file How to Register a user in our application. Till to next Part Allah Hafiz.



Post Reply

Last 10 Members Who Visited This Topic

User avatar ALI RAZA (2), User avatar ali ahmer (1), User avatar azharanraza (1), User avatar Nadia (1)

  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest