0% found this document useful (0 votes)
11 views10 pages

Prototype Phase and Final Viva Questions

The document provides a comprehensive guide for a final year project in computer science, detailing how to run the project, access code, and understand front-end and back-end technologies. It includes HTML, PHP, and MySQL basics, such as form handling, database operations, and PHP syntax, along with examples for practical implementation. Additionally, it covers essential programming concepts like loops, functions, arrays, and session management in PHP.

Uploaded by

itwingisbecp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views10 pages

Prototype Phase and Final Viva Questions

The document provides a comprehensive guide for a final year project in computer science, detailing how to run the project, access code, and understand front-end and back-end technologies. It includes HTML, PHP, and MySQL basics, such as form handling, database operations, and PHP syntax, along with examples for practical implementation. Additionally, it covers essential programming concepts like loops, functions, arrays, and session management in PHP.

Uploaded by

itwingisbecp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Asad Nawaz 03026692707

CS619 – Final Year Project


.
1) How to run project (You should understand complete working of your project)

2) How to open the project code?


For example, supervisor ask you to open the user registration page, in URL view
the name of the page (localhost/project/register.php)
Then open the page with any code editor like notepad++, sublime or any other

3) Basic knowledge of all languages under which your project is developed.

4) What is front-end, back-end

Front End: HTML, CSS, Bootstrap, JavaScript


Backend: PHP & MySQL, Database

5) How to design a button in HTML?


<button>Home</button>

6) Create a link button with VU website


<a href=” https://www.vu.edu.pk”><button>Virtual University of
Pakistan</button></a>

7) HTML for Method?


There are two method of HTML form
(i) Post
Secure method (data is not shown in in URL)
Has no size limitation
(ii) Get
Unsecure Method (Append form-data into URL)
The length of a URL is limited (about 3000 character)
Never use get to send sensitive data (visible in the URL)
Asad Nawaz 03026692707

8) How to add input?


<input type=”text” placeholder=”Enter your name”>

9) Form input type


<input type="button">
<input type="checkbox">
<input type="color">
<input type="date">
<input type="datetime-local">
<input type="email">
<input type="file">
<input type="hidden">
<input type="image">
<input type="month">
<input type="number">
<input type="password">
<input type="radio">
<input type="range">
<input type="reset">
<input type="search">
<input type="submit">
<input type="tel">
<input type="text">
<input type="time">
<input type="url">
<input type="week">

10) Open login form in password input password in not showing. Show
thepassword?
Just change the input type password > text
Now it’s visible to you

11) How to change color of text, button or background?


view the id, name or class to the button, text or div
tag
<button id=”button1”>Home</button>
Asad Nawaz 03026692707

Open the style.css file


Search the respective id, name or class in css file
Change the background-color property value
#button1{
Background-color:green;
}
Change with:
#button1{
Background-color:red;
}
Save the file
If color is not changed yet then delete the history of your browser and again run
your project. Otherwise open the project in incognito window (ctrl+shift+n)

12) How to create table?


<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Phone</th>
</tr>
<tr>
<td>Ali</td>
<td>[email protected]</td>
<td>12345678</td>
</tr>
</table>

13) Write a program that show the message if 5 is greater than


2.You can use any one of the language for this purpose
With javascript:
<script>
If(5>2)
alert(‘5 is greater than 2’);
else
alert(‘5 is not greater than 2’);
</script>
Asad Nawaz 03026692707

With PHP:
<?php
If(5>2)
echo “5 is greater than 2”;
else
echo “5 is not greater than 2”;

?>

14) Design two input that take two number from user and when user click on
buttonthen display the sum of these number?
You can use any of the language for this purpose:
With Javascript:
<input type="number" id="first">
<input type="number" id="second">
<input type="submit" onClick="show()">
<script>
function show(){
var a=document.getElementById("first").value;
var b=document.getElementById("second").value;
var c=(parseInt(a)+parseInt(b));
document.write(c);
}
</script>

With PHP:
<form method=”post”>
<input type=”number” name=”one”>
<input type=”number” name=”two”>
<input type=”submit” name=”submit” value=”Sum”>
</form>
<?php
If(isset($_POST[‘submit’])){
$one=$_POST[‘one’];
$two=$_POST[‘two’];
$c=$one+$two;
Asad Nawaz 03026692707

echo “Sum of Two Number is= ”.$c;


}
?>
15) PHP Syntax?
<?php

?>
16) How to define variable in PHP?
In PHP variable are define with $ (dollar) sign. This is the identify of variable.
<?php
$a=5;
$b=10;
?>
17) How to take sum of two number in PHP?
<?php
$a=5;
$b=10;
$c=$a+$b;
echo “sum of two number is =”.$c;
?>
18) PHP echo and print statement
They are both used to output data to the screen.
The differences are small: echo has no return value while print has a return value
of 1. echo can take multiple parameters while print can take on argument. Echo is
faster than print.
19) Comments in PHP
A comment in PHP code is a line that is not executed as a part of the program. Its
only purpose is to be read by someone who is looking at the code.
// this is single line comments
# this is also single line comment
/*
Multi-line comments
*/
20) PHP form handling
Result can be achieved using HTTP post method:
$_POST[‘’] Method
Result can be achieved using HTTP get method:
Asad Nawaz 03026692707

$_GET[‘’] Method
For better understanding please watch this video:
https://youtu.be/M2pbe1Afkx0

21) What is isset() function


Isset() function checks whether a variable is set or not, which means that it has to
be declared and is not NULL…. This functions returns true if the variable exists
and is not null, otherwise it return false.
e.g: if we want to insert data into table. We want to insert data only when we
click on submit button then we use this isset() function.
22) PHP include
It is possible to insert the content of one PHP file to another one with the include
statement. We include the external PHP files through this statement.
Include_once “”;
or
Include “”;
e.g: include_once “header.php”;
include_once “footer.php”;
23) PHP session
A session is a way to store information (in variables) to be used across multiple
pages.
A session is started with session_start() function.
Set session variable:
$_SESSION[‘admin’]=”admin123”;
Session variable are retrieve at any page just we need to use the session_start()
function before using the session variable.
Destory a session:
// remove all the session variable
session_unset();
// Destroy the session
session_destroy();
For better understanding please watch this video:
https://youtu.be/WfdV2agfWyM

24) PHP Loops


While – through a block of code as long as the specified condition is true
Asad Nawaz 03026692707

Do… while – through a block of code one, and then repeat the loop as long as the
specified condition is true.
For- loop through a block of code a specified number of items
Foreach – through a block of code for each element in an array
While loop syntax:
<?php
$x = 1;

while($x <= 5) {
echo "The number is: $x <br>";
$x++;
}
?>
do while loop syntax:
<?php
$x = 1;

do {
echo "The number is: $x <br>";
$x++;
} while ($x <= 5);
?>
For loop syntax:
<?php
for ($x = 0; $x <= 10; $x++) {
echo "The number is: $x <br>";
}
?>
Foreach loop syntax:
<?php
$colors = array("red", "green", "blue", "yellow");

foreach ($colors as $value) {


echo "$value <br>";
}
?>
25) PHP functions
Asad Nawaz 03026692707

Function is a block of code that can be used repeatedly in a program


There’re two type of function
I) User-define function
how to create user define function:
function sum(){
$a=5;
$b=10;
$c=$a+$b;
echo “sum is= ”.$c;
}
Sum(); // this is function call
For better understanding of this topic please watch this video:
https://youtu.be/J2pS QgEsg

II) Built-in function


Session_start();
Mysqli_connect();
Date();
Etc…..

26) What is an array?


An array is a special variable , which can hold more than one value at a time.
In PHP there’re three type of array:
i) Indexed arrays – arrays with a numeric index
ii) Associative arrays – arrays with named keys
iii) Multidimensional arrays – arrays containing one or more arrays

27) How to create database in phpmyadmin


This is complete implementation process. That’s why
You should understand from this video:
https://youtu.be/QigqU-wLVhI

28) How to create database connection?


<?php
$con=mysqli_connect(‘localhost’,’root’,’password’,’databasename’);
?>
// localhost: servername
Asad Nawaz 03026692707

// root: this is the username in the server


// password: write the password if we set the password in server
// databasename: please enter the name of your database
How to check database connection is successful or not?
If($con){
Echo “Successfull”;
}
Else{
Echo “sorry”;
}
29) How to insert data into table in PHP MySQL
The insert into statement is used to add new records to a MySQL table:

Insert into table_name values(‘value1’,’value2’,’value3’,….)


For better understanding watch this video:
https://youtu.be/3xilobfZ6C4

30) Select data from a MySQL Database


The select statement is used to select data from one or more tables:

Select column_name from table_name

We can use the * character to select ALL coulumn from a table:

Select * from table_name


For better understanding watch this video:
https://youtu.be/rzqTW9OWHlg

31) Why to use WHERE clause?


The where clause is used to filter record.
The where clause is used to extract only those record that fulfill a specified
condition:

Select * from student where roll_no=1

32) Delete data from a MySQL table


The delete statement is used to delete record from a table:
Asad Nawaz 03026692707

Delete from student where roll_no=1


For better understanding watch this video:
https://youtu.be/1eKTotaitiI

33) Update data in a MySQL table


The update statement is used to update existing record in a table:

Update student set name=”new value”, address=’new value’ where roll_no=1


For better understanding watch this video:
https://youtu.be/j7kGldqHipw

34) What is Primary and Foreign Key?


Primary Key: A primary key is a column or set of column in a table whose value
uniquely identify a row in the table. A relational database is designed to enforce
the uniqueness of primary keys by following only one row with a given primary
key value in a table.
Foreign Key: A foreign key is a column or set of column in a table those value
correspond to the value of the primary key in another table.
For better understanding please watch this video:
https://youtu.be/W62Fg_63--I

35) PHP request method ($_REQUEST)


PHP $_REQUEST is a PHP super global variable which is used to collect data after
submitting an html form.
We use request method when we want to send the id of any table to another
page for select, update or delete the record in MySQL table.
How to use request method?
<a href=”update.php?id=<?php echo $row[‘id’];?>”>Update</a>
When we click on update then id is send to the update.php page. Now we get the
id through request method on this page.
How to get this id?
$id=$_REQUEST[‘id’];
This method we use to get the id on update.php

You might also like