Awad New Manual
Awad New Manual
Tech(R22)–CSE
Academic Year:2024-2025
1
CBIT–B.Tech(R22)–CSE
Course Credits
Category: Professional Core 1.5
Course Type: Lab Lecture-Tutorial-Practice: 0-0-3
Prerequisites: MySQL Continuous Evaluation: 30
YEAR& IIIB.TECH-I SEM Semester end Evaluation: 70
PROGRAMME CSE
Total Marks 100
Course • Learn how to create dynamic websites using PHP and establish database connectivity.
objectives • Explore SMS API and session management
• Understand the common Web Application Vulnerabilities and provide Security.
• Acquire the knowledge of external libraries to generate various types of documents
and files.
• Understand the difference between traditional hosting services and Cloud Hosting
service
Course After completion of the course, students will be able to
Outcomes CO1 Create dynamic websites using PHP and MySQL
CO2 Handle Authentication using Sessions, JWT.
CO3 Secure Web applications from common attacks like Injection, XSS
Module 3:
Php basics: Basic Syntax, primitive types, Variables, Constants, Expressions,
Operators, Control structures, functions.
Task: Develop a PHP application and run it with a command-line interpreter
2
CBIT–B.Tech(R22)–CSE
Module 4:
Handling HTML Forms: Predefined Variables, Reading data from web form controls
like input, textarea, select etc., Handling File Uploads.
Task: Develop an Add Student Profile Page which accepts all student details including
photo and display them in order.
Module 5:
Predefined Functions and Files: Arrays, Associative Arrays, Multidimensional Arrays,
Array functions, String functions, Date and Time functions, File Handling: Open, Close,
Create, Read, Write, Append.
Task: Implement an effective Logging System using files in PHP.
Module 6:
Classes and Objects: Creating classes and objects, Visibility, Constructor and
Destructor, Inheritance, static keyword, interfaces, class Abstraction, namespaces
Task: Design and implement Class diagram representation of Student Management
System for a college using PHP.
Module 7:
Database Connectivity with MySql: Establish a database Connection using mysqli,
Prepare SQL Statement, Bind parameters, Execute the statement, bind the result.
Task: Develop Add Student Profile Page to store data into the database and develop a
webpage to retrieve the student details based on the Roll Number or any unique ID.
Module 8:
HTTP is a Stateless Protocol: Handling Cookies and Sessions, Implementation of JSON
Web Tokens (JWT), SMS API.
Task: Design and develop a User Authentication System (Login-Logout functionality)
using cookies, sessions, JWT, and SMS API. Also, identify which is suitable for your
application
Module 9:
Exception Handling and Security: Handle Database connectivity exceptions, SQL
Injection Vulnerability, Cross-site scripting, Session hijacking, and Session fixation
Task: Secure all your PHP applications from common vulnerabilities like Injection, XSS,
Session hijacking and fixation, and other exceptions
Module 10:
PHP Libraries: Read data from Excel Files, Generate dynamic Excel Files, PDF files, and
Word Documents.
Task: Design an Administrator Portal through which administrators can be able to
upload student data into the database, Download the student data, Generate
certificates, etc.
Module 11:
Hosting service provider: Public IP Address, Nameservers, Domain Name, Understand
cPanel Modules: File Manager, Databases, Email Accounts, One-Click Installers, DNS,
Other Configuration & Monitoring Controls.
Task: Host a PHP-MySQL based application on the internet using the Web Hosting
3
CBIT–B.Tech(R22)–CSE
Service Provider of your choice (000webhost, Hostinger, Heroku, Godaddy, etc.)
Module 12:
Cloud Hosting: Advantages of Cloud Hosting, Creating Instances or droplets,
Managing Roles, Scaling the Application, Securing the instances, Monitoring Tools,
etc.
Task: Host a PHP-MySQL based application on the internet using the Cloud Hosting
Provider of your choice (Amazon Web Services, Google Cloud Platform, DigitalOcean,
etc.)
4
CBIT–B.Tech(R22)–CSE
PEO PEO
No. Description
PEO 2 Graduates of Computer Science and Engineering will have successful career
in software and hardware industries or pursue higher studies/research or
become entrepreneurs.
PEO 3 Graduates of Computer Science and Engineering will exhibit teamwork, good
communication skills and ethical practices in their career.
5
CBIT–B.Tech(R22)–CSE
POs PO STATEMENT
Modern tool usage: Create, select, and apply appropriate techniques, resources
andmodern engineering and IT tools, including prediction and modeling to
PO5 complex engineering activities, with an understanding of the limitations.
6
CBIT–B.Tech(R22)–CSE
Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate
PO7 the knowledge of, and need for sustainable development.
Life-long learning: Recognize the need for, and have the preparation and
PO12 ability to engage in independent and life-long learning in the broadest context
of technological change.
7
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20III-I SEM
CBIT–B.Tech(R22)–CSE
GENERAL INSTRUCTIONS:
1. The experiments have been designed to be performed within the laboratory time.
2. To successfully complete the experiment in one lab turn, come prepared to the
laboratory.
3. Read the experiment in advance.
4. To Install python lab software.
5. Open the Idle shell and go to file menu to open new script.
6. In the new script to write python programs. And save it go run.
7. Record stepwise observe the outputs for each program.
8. Get the observation signed by the instructor.
9. Always take safety precautions with using computers.
Page 8
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
1.Design a Student Profile Data Management System for a college. Create a Database and its
associated tables.
Web Server:
1. A server commonly refers to a computer program that receives and responds to requests
made over a network.
2.A web server is used for storing and transferring a website's content. A web server sends
all the text, video, application data, graphics, and other content that users may require. The
web server requests the website's data each time a user clicks a link or begins a download.
Database Server:
Database servers are used to store and manage databases that are stored on
the server and to provide data access for authorized users.
Private IP Address:
1.An IP address is the identifier that enables your device to send or receive data packets
across the internet.
2.It holds information related to your location and therefore making devices available for
two-way communication.
3.Private IP address of a system is the IP address that is used to communicate within the
same network. Using private IP data or information can be sent or received within the
same network.
Port Address:
1.A port number is a way to identify a specific process to which an internet or other network
message is to be forwarded when it arrives at a server.
2.Port is an address of a 16-bit unsigned integer number which ranges from 0 to 65535
Server-side Programming:
1.Server-side programming refers to the process of writing and executing code on the server
side of a client-server architecture.
2. Users don't see this development because it happens on servers.
Page 9
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Task:
We will learn how to install the XAMPP server on windows platform step by step. Follow
the below steps and install the XAMPP server on your system.
Step 1: Click on the above link provided to download the XAMPP server according to
your window requirement.
Page 10
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step 2: After downloading XAMPP, double click on the downloaded file and allow XAMPP
to make changes in your system. A window will pop-up, where you have to click on
the Next button.
Step 3: Here, select the components, which you want to install and click Next.
Step 4: Choose a folder where you want to install the XAMPP in your system and
click Next.
Page 11
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step 6: XAMPP is ready to install, so click on the Next button and install the XAMPP.
Page 12
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 13
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step 9: XAMPP is ready to use. Start the Apache server and MySQL and run the php
program on the localhost.
How to run PHP programs in XAMPP PHP is a popular backend programming language.
PHP programs can be written on any editor, such as - Notepad, Notepad++,
Page 14
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Dreamweaver, etc. These programs save with .php extension, i.e., filename.php inside the
htdocs folder.
As I'm using window, and my XAMPP server is installed in C drive. So, the path for the
htdocs directory will be "C:\xampp\htdocs".
PHP program runs on a web browser such as - Chrome, Internet Explorer, Firefox, etc.
Below some steps are given to run the PHP programs.
1. <?php
2. echo "Hello World!";
3. ?>
Step 2: Save the file with hello.php name in the htdocs folder, which resides inside the
xampp folder.
Step 3: Run the XAMPP server and start the Apache and MySQL.
Step 4: Now, open the web browser and type localhost http://localhost/hello.php on your
browser window.
Step 5: The output for the above hello.php program will be shown as the screenshot
below:
2.Design a Student Profile Data Management System for a college. Create a Database and its
associated tables.
Step-1:
Page 15
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-2:
In that select databases Create Database and give the name.
CREATE DATABSE:
Page 16
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-3:
Observe the remaining databases Student Database found.
Step-4:
Open the Database and Create the table name Student-info.
Page 17
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-5:
Step-7:
By using Insert command insert the table values by using insert tab you may passible to insert
the values.
Page 18
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-8:
In this use Insert command you may also enter.
The values like this I st row inserted.
II nd row inserted.
Page 19
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 20
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 21
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-9:
And again create the table name student marks.
Step-10:
Insert the value using Insert tab.
Page 22
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-11:
Insert the values using Insert command.
Page 23
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-12:
If we want to see the result Print option in the phpMyAdmin Home Screen you will see the
result page as follows.
Page 24
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step-13:
If you want to Move, Copy, Alter, Delete, Drop a database from phpMyAdmin the Go to
operations we may see the operations like as below.
OPERATIONS:
HOW TO ALTER, MOVE, COPY
Page 25
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 26
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step:2 Program:
open Notepad-> save the program with .php extinction.
Ex: fact.php
<?php
$count = 0;
$num = 2;
while ($count <30 )
{
$div_count=0;
for ( $i=1; $i<=$num; $i++)
{
if (($num%$i)==0)
{
$div_count++;
}
}
if ($div_count<3)
{
echo $num." , ";
$count=$count+1;
}
$num=$num+1;
}
?>
Step:3 Run Program:
Page 27
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step:4
Page 28
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
4. Develop an Add Student Profile Page which accepts all student details including
photo and display them in order.
PROGRAMS:
Addstudent.php
<?php include('../header.php') ?>
<div>
<div class="row">
Page 29
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Deleterecord.php
<?php
include('../dbcon.php');
$delete_id = $_GET['Delete'];
$profile_pic = $_GET['Picture'];
$result = mysqli_query($conn,$sql);
Page 30
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
if ($result) {
unlink("../databaseimg/".$profile_pic);
echo '<script>window.open("deletestudent.php?deleted=Record deleted
successfully","_self")</script>';
}
?>
Deletestudent.php
<?phprequire_once('../include/Session.php');?>
<?phprequire_once('../include/Functions.php');?>
<?php echo AdminAreaAccess(); ?>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3 jumbotron ">
<div style="text-align: center;">
<form action="<?php echo
htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post"
enctype="multipart/form-data" >
Page 31
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 32
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
</tr>
<?php
include('../dbcon.php');
if (isset($_POST['search'])) {
$standard = $_POST['standard'];
$result = mysqli_query($conn,$sql);
if (mysqli_num_rows($result)>0) {
while ($DataRows = mysqli_fetch_assoc($result)) {
$Id = $DataRows['id'];
$RollNo = $DataRows['rollno'];
$Name = $DataRows['name'];
$City = $DataRows['city'];
$Pcontact = $DataRows['pcontact'];
$ProfilePic = $DataRows['image'];
?>
<tr>
<td><?php echo $RollNo;?></td>
<td><?php echo $Name; ?></td>
Page 33
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
} else {
echo "<tr><td colspan ='6' class='text-center'>No Record
Found</td></tr>";
}
}
?>
</table>
</div>
<div class="container">
<div class="row">
Page 34
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Admin.header.php
<div class="header-section jumbotron">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="text-center">
<span><a href="admindash.php" class="btnbtn-
success" style="float: left;">BACK TO DASHBOARD</a><span>
WELCOME TO ADMIN DASHBOARD
<span><a href="logout.php" class="btnbtn-
success" style="float: right;">LOGOUT</a><span>
</h2>
</div>
</div>
</div>
Page 35
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
</div>
Imageupload.php
<?php
$imgName = $_FILES['simg']['name'];
$imgTmpName =$_FILES['simg']['tmp_name'];
$imgSize = $_FILES['simg']['size'];
$imgError = $_FILES['simg']['error'];
$imgExt = explode('.', $imgName);
$actualFileExt = strtolower(end($imgExt));
$allowed = array('jpg','jpeg','png','pdf');
if (in_array($actualFileExt, $allowed)) {
if ($imgError === 0) {
if ($imgSize< 50000) {
$fileDestination = '../databaseimg/'.$imgName;
move_uploaded_file($imgTmpName, $fileDestination);
} else {
echo "file size is too big";
}
}else{
Page 36
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Updaterecord.php
<?phprequire_once('../include/Session.php');?>
<?phprequire_once('../include/Functions.php');?>
<?php echo AdminAreaAccess(); ?>
<?php
include('../dbcon.php');
$update_record= $_GET['Update'];
$sql = "select * from student where id = '$update_record'";
$result = mysqli_query($conn,$sql);
Page 37
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
$Standard = $data_row['standard'];
?>
Page 38
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 39
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<?php
//This php code block is for editing the data that we got after clicking on update
button
if (isset($_POST['submit'])) {
if (!empty($_POST['roll']) && !empty($_POST['fullname'])) {
include ('../dbcon.php');
$id = $_GET['update_id'];
$roll=$_POST['roll'];
$name=$_POST['fullname'];
$city=$_POST['city'];
$pphone=$_POST['pphone'];
$standard=$_POST['standard'];
$Execute = mysqli_query($conn,$sql);
if ($Execute) {
$_SESSION['SuccessMessage'] = " Data Updated
Successfully";
Redirect_to("updatestudent.php");
Page 40
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
?>
Logout.php
<?php
session_start();
session_destroy();
header('location:../login.php');
?>
OUTPUT:
Page 41
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 42
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 43
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 44
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
The most important thing is when and how to log errors. You can log PHP errors at your
will when working in the dev mode. Either create a PHP error log file or save them as
notifications on different channels, as you get the convenience of logging errors per your
requirements.
PHP errors occur when something is off-base within the code. They can be as complex
as calling an incorrect variable or as simple as missing a semicolon. You must
understand the kind of errors you face to solve them effectively.
Warning Error
PHP warning errors alert about a problem that may cause a more critical error in the long
run. Warning errors do not break down the code execution and commonly occur when
using a file path that doesn’t exist.
1. <?php
2. echo "Warning error"';
3. include("external_file.php");
4. ?
5. >
There is no file named “external_file,” so the output will display an error message box,
and the execution will not break down.
Notice Error
Notice errors are minor; like warning errors, they don’t halt code execution. These errors
can confuse the system in analyzing if there’s an actual mistake or if it’s just the standard
code. Notice errors usually occur when the script needs access to an undefined variable.
Page 45
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Syntax Error
A syntax error is often caused by parsed, misused, or missing symbols. When the
compiler catches the error, it terminates the script.
Misspellings
PHP Parse error: syntax error, unexpected ‘5’ (L_NAME), expecting ‘)’ i
n /home/u802426761/domains/username/public_html/wp-config.php on line 3
2
Fatal Error
A fatal error happens when the code calls the function, but the function itself isn’t
characterized. Unlike other PHP errors, a fatal error breaks down the execution and
sometimes crashes the application as well. There are three types of fatal errors:
A startup fatal error happens when the framework can’t run the code due to a
mistake during installation.
A compile-time fatal error occurs when the developer uses an undefined function,
class, or non-existent variable or data.
Runtime fatal error is similar to a compile-time fatal error, but happens during the
program execution.
Page 46
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
To log errors in PHP, open the php.ini file and uncomment/add the following lines of
code.
If you want to enable PHP error logging in individual files, add this code at the top of the
PHP file.
1. ini_set('display_errors', 1);
2.
3. ini_set('display_startup_errors', 1);
4.
5. error_reporting(E_ALL);
Now, you must enable only one statement to parse the log errors in the php.ini file:
display_errors = on.
Page 47
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<?php
ini_set("display_errors",1);
ini_set("log_errors",1);
ini_set("error_log","temp/error_log.php");
$x=5;
$y=0;
if($y==0)
try
$value=$x%$y;
catch(Exception $e)
Page 48
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
$message="Exception:".$e->getMessage();
?>
OUTPUT:
Page 49
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Class Name: The name of t he class appear s in t he upper port ion. Whet her you’re
t alking about t he classifier or an object .
Class Attributes: The class’s att ribut es are found in t he middle port ion. Use t his
sect ion t o describe t he class’s charact erist ics. When specifying a specific inst ance
of a class, t his is only required.
Class operations: are included in t he bottom part (met hods). Each act ion has it s
own line when displayed in a list format . The operat ions are t he met hods by
which a class int eract s wit h dat a.
Class Connections: Depending on t he access modifier, each class has a different
level o f access (visibilit y). The following are t he access levels and t he symbo ls
Page 50
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Each of t hese class diagram component s shows t he overall Class st ruct ure.
Emphasizing t he Syst em’s st ruct ure would be much easier by using t hese Class
Diagram symbo ls.
7. Develop Add Student Profile Page to store data into the database and develop a
webpage to retrieve the student details based on the Roll Number or any unique ID.
Admindash.php
<?phprequire_once('../include/Session.php');?>
<?phprequire_once('../include/Functions.php');?>
<?php echo AdminAreaAccess(); ?>
Page 51
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<div class="col-md-12">
<h2 class="text-center">
WELCOME TO ADMIN DASHBOARD
<span><a href="logout.php" class="btnbtn-success"
style="float: right;">LOGOUT</a><span>
</h2>
</div>
</div>
</div>
</div>
<div class="container">
<div>
<div class="row">
<div class="col-md-6 col-md-offset-3 jumbotron" >
</div>
Page 52
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
</div>
</div>
header.phpAdmin.php
<div class="header-section jumbotron">
Page 53
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<div class="container">
<div class="row">
<div class="col-md-12">
<h2 class="text-center">
<span><a href="admindash.php" class="btnbtn-success"
style="float: left;">BACK TO DASHBOARD</a><span>
WELCOME TO ADMIN DASHBOARD
</h2>
</div>
</div>
</div>
</div>
Updatestudent.php
<?phprequire_once('../include/Session.php');?>
<?phprequire_once('../include/Functions.php');?>
<?php echo AdminAreaAccess(); ?>
Page 54
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<option>1st</option>
<option>2nd</option>
<option>3rd</option>
<option>4th</option>
<option>5th</option>
</select>
<input type="submit" name="search" value="SEARCH"
class="btnbtn-success">
</form>
</div>
</div>
</div>
<?php
echo ErrorMessage();
echo SuccessMessage();
?>
<th>Full Name</th>
<th>City</th>
<th>parent phone No.</th>
<th>Profile Pic</th>
Page 55
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<th>Update</th>
</tr>
<?php
include('../dbcon.php');
if (isset($_POST['search'])) {
$standard = $_POST['standard'];
$result = mysqli_query($conn,$sql);
if (mysqli_num_rows($result)>0) {
while ($DataRows = mysqli_fetch_assoc($result)) {
$Id = $DataRows['id'];
$RollNo = $DataRows['rollno'];
$Name = $DataRows['name'];
$City = $DataRows['city'];
$Pcontact = $DataRows['pcontact'];
$Standard = $DataRows['standard'];
$ProfilePic = $DataRows['image'];
?>
<tr class="text-center">
<td><?php echo $RollNo;?></td>
<td><?php echo $Standard;?></td>
<td><?php echo $Name; ?></td>
Page 56
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<td>
<imgsrc="../databaseimg/<?php echo
$ProfilePic;?>" alt="img"><br><br>
<form action="UpdateImg.php" method="post"
enctype="multipart/form-data">
<input type="file" name="updateimg"
style="float: left;" class="btnbtn-info btn-sm">
<input type="hidden" name="id"
value="<?php echo $Id; ?>">
<input type="submit" name="submitimg"
value="UPDATE" class="btnbtn-warning btn-sm" style="float: right;"><br>
</form>
</td>
<td><a href="UpdateRecord.php?Update=<?php echo $Id;
?>" class="btnbtn-warning">UPDATE</a></td>
</tr>
<?php
} else {
echo "<tr><td colspan ='7' class='text-center'>No Record
Found</td></tr>";
}
}
?>
</table>
Page 57
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
</div>
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h2><?php echo @$_GET['updated']; ?></h2>
</div>
</div>
</div>
<?php include('../footer.php');?>
Updateimage.php
<?phprequire_once('../include/Session.php');?>
<?phprequire_once('../include/Functions.php');?>
<?php include('../dbcon.php') ?>
Page 58
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<?php
if(isset($_POST['submitimg'])) {
$ID = $_POST['id'];
$imgName = $_FILES['updateimg']['name'];
$imgTmpName =$_FILES['updateimg']['tmp_name'];
$imgSize = $_FILES['updateimg']['size'];
$imgError = $_FILES['updateimg']['error'];
$imgExt = explode('.', $imgName);
$actualFileExt = strtolower(end($imgExt));
$allowed = array('jpg','jpeg','png','pdf');
if (in_array($actualFileExt, $allowed)) {
if ($imgError === 0) {
if ($imgSize< 50000) {
$fileDestination = '../databaseimg/'.$imgName;
move_uploaded_file($imgTmpName, $fileDestination);
} else {
echo "file size is too big";
}
} else {
echo "error while uploading your file";
}
} else {
echo "you cannot upload files of this type";
Page 59
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
if(empty($imgName)) {
$_SESSION['ErrorMessage'] = "Please Select
an Image First";
Redirect_to("updatestudent.php");
} else {
if ($result) {
$_SESSION['SuccessMessage']
= "Image Updated Successfully";
Redirect_to("updatestudent.php");
}
}
}
?>
8.Design and develop a User Authentication System using cookies, sessions, JWT, and
SMS API. Also, identify which is suitable for your application.
Connection.php
<?php
$servername="localhost";
Page 60
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
$username="root";
$password="";
$dbname="college";
$conn=mysqli_connect($servername,$username,$password,$dbname);
if($conn)
{
echo"";
}
else
{
session_start();
include('connection.php');
?>
<form action=" " method="POST">
Username<input type="text" name="username"><br><br>
{
$user=$_POST["username"];
Page 61
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
$psd=$_POST["password"];
$query="SELECT*FROM STUDENT WHERE USERNAME='$user' ";
$data=mysqli_query($conn,$query);
$total=mysqli_num_rows($data);
if($total==1)
{
$_SESSION['user_name']=$user;
echo("login successful");
header('location:welcome.php');
}
else
{
echo("login failed!");
}
}
?>
Welcome.php
<?php
session_start();
echo"welcome".$_SESSION['user_name'];
?>
OUTPUT:
Page 62
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Page 63
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
9. Secure your PHP applications from common vulnerabilities like Injection, XSS,
Session hijacking and fixation, and other exceptions.
admin.php
<?php
session_start();
if(!isset($_SESSION["admin"]))
{
Page 64
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
echo "<h1 style='color: red;'>You are not authorized to view this page.</h1>
<a href='index.php'>Back to login</a>";
else
echo "<h2>You are logged in as " . $_SESSION["admin"]["user"] . " and you have been
granted access.</h2>";
……………………………………………………………………………………..
Index.php
<?phpsession_start(); ?>
<?php
if(isset($_SESSION["admin"]))
{
header("Location: admin.php");
exit();
Page 65
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
if(isset($_POST["username"], $_POST["password"]))
$username = htmlentities($_POST["username"]);
$password = htmlentities($_POST
["password"]);
{
//session_regenerate_id(true); //uncomment this line for improved session security
$_SESSION["admin"] = array(
"user" => $username,
);
header("Location: admin.php");
exit();
else
Page 66
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
{
echo "<div style='color: red'>Incorrect username / password.</div>"; }
}
?>
<!DOCTYPE
html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body>
<?php
name="password" /></p>
<input type="submit" value="Login" />
</form>
</body>
</html>
…………………………………………………………………………………………………….
logout.php
Page 67
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
<?php
session_start();
//session_regenerate_id(true); //uncomment this line for improved session security
session_unset();
session_destroy();
header("Location: index.php");
exit();
………………………………………………
Output:
Page 68
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
10.Design a Administrator Portal through which administrator can be able to upload student
data into the database, Download the student data, Generate certificates, etc.
Index.php
<?php
header('content-type:image/jpeg');
$font=realpath('arial.ttf');
$image=imagecreatefromjpeg("format.jpg");
$color=imagecolorallocate($image, 51, 51, 102);
$date=date('d f, y');
imagettftext($image, 18, 0, 880, 188, $color, $font, $date);
imagejpeg($image);
Page 69
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
imagedestroy($image);
?>
OUTPUT:
11. Host a PHP-MySQL based application on the internet using the Web Hosting Service
Provider of your choice (000webhost, Hostinger, Heroku, Godaddy, etc.)
Page 70
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step 3: From the file manager option go to public.html> Click public.html> here you will
find an option named upload> Click the upload option.
Page 71
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step 4: After clicking on the upload option you will get a select file section where you can
upload your own PHP file. You must know the file size before uploading.
Page 72
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
That’s how you can upload your PHP file to the server.
You can also edit your PHP file from index.php. You need to go index.php> click on the
right button> there you will find out the edit option.
Page 73
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
After editing, you need to click on save changes. Then your editing will be saved on the
system.
Page 74
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Step6: If your website uses a database, you need to import it along with your website
files:
Page 75
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
When your domain name points to your web host, enter the domain name in your
browser and see if it points you to your website. If you follow all the instructions correctly,
your website will be displayed like this:
12. Host a PHP-MySQL based application on the internet using the Cloud Hosting Provider of
your choice (Amazon Web Services, Google Cloud Platform, DigitalOcean, etc.)
sign up for the free trial; if you don’t have one, you can create one here (remember to keep track of
your account username and password, because you’ll need them in the next step).
Once you’ve signed in, provide Google with some personal information and your credit card details.
Page 78
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
It’s important to note that you’re signing up for a free trial and your credit card won’t be billed
unless you migrate to a paid account. The trial includes $300 of free credit, valid for 60 days. Once
the trial ends, your account will automatically be paused and you’ll only be charged if you explicitly
choose to upgrade to a paid account.
The Google elves will go away for a minute or so to verify your information and if all is well, you
will be redirected to the Google Developers Console, which allows you to manage your billing
account, create new projects and get support. You should see that your free trial is now active in the
billing credits section.
You should also receive an account confirmation email, which tells you that your account is good to
go.
Bitnami uses the Google Compute Engine API in order to manage and launch cloud servers, so this
is a good time to enable the API. Plus, new cloud servers always launch within a project, so you’ll
also need to create a project. Both these tasks are easy to do from the Google Developers Console.
Follow these steps:
While you’re logged in to the Google Developers Console, select the "Projects" menu
item and click the "Create Project" button.
Enter a name for the project (such as "My Bitnami Project") and make a note of the
auto-generated project ID.
Page 79
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Click "Create" to create and activate the project. You should now see it in the project
listing.
Select the new project name in the project listing, and you’ll be transferred to the project
information page.
Select the "APIs" menu item in the left navigation bar.
Look through the list of APIs, or use the API search box to search for the term "compute
engine". Find and turn on the Google Compute Engine API.
Page 80
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Verify that the Google Compute Engine API now appears in the list of enabled APIs.
The next step is to create a Bitnami account, so that you can launch a cloud server with LAMP
packaged by Bitnami image. If you have a Google, Microsoft or Github account, you can use your
credentials from those services with Oauth to create your Bitnami account.
If you don’t have accounts with those services (or you don’t want to use them), you can use your
email address and password to create a Bitnami account, as described below:
Page 81
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Bitnami will send you an email with a verification link which you’ll need to click or browse to, to
activate your account. This will also sign you in to your Bitnami account.
Page 82
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
The easiest way to set up your Google cloud server with LAMP packaged by Bitnami is via
the Bitnami Launchpad for Google Cloud Platform, which gives you a simple control panel to
provision, start, stop, connect to and check status of your cloud servers. However, to use it, you
must first connect your Google Cloud Platform and Bitnami accounts.
To do this:
The Launchpad will recognize your Bitnami credentials and automatically sign you in.
The next step is to set up an administrative password and connect your Google Cloud Platform
account with your Bitnami account. To do this:
Page 83
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
The Bitnami Vault password offers an additional level of protection against misuse:
you’ll need to enter it when performing certain operations, such as creating new cloud
servers. Again, make sure you note it down for future reference.
Your Bitnami Vault password is different from your Google Account password.
Once your password has been accepted, you’ll be redirected back to the Launchpad
page. Select "Virtual Machines" again in the Launchpad menu.
You’ll be transferred to an authorization page, where you can confirm that the Bitnami
Launchpad is authorized to connect to your Google Cloud Platform account. Click the
"Accept" button on the page to proceed.
Page 84
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
You’ll now be redirected back to the Bitnami Launchpad, and asked to select a project
within which to launch new cloud servers. Enter the project ID you noted in Step 1.
Your Google Cloud Platform and Bitnami accounts are now connected, and you can launch new
cloud servers with Bitnami application stacks.
Page 85
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Define a name, size and region for your cloud server. You can choose from a "micro"
server, which uses a shared CPU to a "high CPU" server, which has 16 dedicated virtual
cores. For more information, refer to the Google Compute Engine pricing sheet.
A "micro" server will work just fine for most PHP application development tasks.
Page 86
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Confirm your selection by hitting the "Create Virtual Machine" button at the end of the
page.
The Bitnami Launchpad will now begin spinning up the new server. The process usually takes a few
minutes: a status indicator on the page provides a progress update.
Page 87
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Once the cloud server has been provisioned, the status indicator will show that it’s "running", and
the Bitnami Launchpad page will display the server details, including its IP address.
At this point, you should be able to browse to the cloud server, either by clicking the link in the
Bitnami Launchpad (a new browser tab will open) or entering the cloud server IP address directly
into your browser’s address bar. You should see a welcome page like the one below (just so you
know, it’s served up by Apache, which is part of LAMP packaged by Bitnami).
Page 88
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Once the server is provisioned, you need to gather the security credentials you will need to begin
using it. To do this:
Go back to the Bitnami Launchpad for Google Cloud Platform page and in the "Virtual
Machines" section, select the running server. This will launch the server information
page.
From the server information page, download the .ppk file which contains the SSH access
credentials you will need to connect to the server. Typically, this file is named using the
format bitnami-[google-project]-[nn].ppk. If you’re using Mac OS X or Linux, you
should instead download the corresponding .pem file.
Page 89
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
By default, Bitnami Launchpad creates a user account named 'user' and an auto-
generated password when a new server is provisioned. You will need this password
when accessing Bitnami-supplied applications (including MySQL). Go back to the
server information screen, look in the "Credentials" section of the "Application Info"
panel, and display and make a note of the application password.
The Launchpad page also includes controls to reboot, shut down or delete the server.
Page 90
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
You can now connect to the cloud server and test PHP to make sure it’s working correctly and has
all the extensions you need. The easiest way to do this is with PuTTY, a free SSH client for
Windows and UNIX platforms.
Page 91
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
In the "Connection → SSH → Tunnels" section, create a secure tunnel for the
phpMyAdmin application by forwarding source port "8888" to destination port
"localhost:80".
Click the "Add" button to add the secure tunnel configuration to the session.
In the "Connection → SSH → Auth" section, select the private key file (*.ppk) you
saved in the previous step.
Page 92
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
In the "Connection → Data" section, enter the username 'bitnami' into the "Auto-login
username" field.
Go back to the "Session" section and save your changes by clicking the "Save" button.
Click the "Open" button to open an SSH session to the server.
PuTTY will first ask you to confirm the server’s host key and add it to the cache. Go
ahead and click "Yes" to this request.
Page 93
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
By default, LAMP packaged by Bitnami includes running Apache and MariaDB servers, and all the
packages that come with the stack are located in the /opt/bitnami directory. Your first step should be
to create a phpinfo.php file in the Apache web server root at /opt/bitnami/apache2/htdocs directory
to verify PHP’s capabilities.
shell> cd /opt/bitnami/apache2/htdocs
shell> echo "<?phpphpinfo(); ?>" >phpinfo.php
Page 94
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Once the file has been copied, browse to http://[your-cloud-server-hostname]/phpinfo.php and you
should see the output of the phpinfo() command.
With this, you know that your PHP installation is configured and working correctly.
You can also check that MariaDB is working by launching the MariaDB command-line client at the
shell prompt.
shell>mysql -u root -p
When prompted, enter the application password retrieved in the previous step. The client should
start up and connect to the local MariaDB server, displaying a welcome message as shown below.
Page 95
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
You should also be able to access phpMyAdmin through the secure SSH tunnel you created, by
browsing to http://127.0.0.1:8888/phpmyadmin.
To log in, use username 'root' with the application password from the previous step.
In case you’d like to troubleshoot errors or modify the configuration for Apache, PHP or MariaDB -
for example, adjusting the maximum upload file size in PHP or changing the path to the MariaDB
data directory - here are the locations for key configuration and log files in LAMP packaged by
Bitnami:
Page 96
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
PHP /opt/bitnami/php/etc/php.ini -
Usually, you’ll need to restart your server(s) for your changes to take effect. LAMP packaged by
Bitnami includes a control script that lets you easily stop, start and restart Apache, MariaDB and
PHP. The script is located at /opt/bitnami/ctlscript.sh. Call it without any arguments to restart all
services:
Or use it to restart a specific service only by passing the service name as argument - for example
'mariadb':
image::common/mariadb-restart.jpg
Your cloud server is now provisioned, secured and has a functional PHP/MariaDB environment. All
that’s left is for you to transfer your application code from your local XAMPP environment to your
cloud server and set up the database.
The easiest way to transfer files to the server is with FTP or SFTP. Although you can use any
FTP/SFTP client, I like FileZilla, a cross-platform, open source and feature-rich client. Download it
from the FileZilla website and install it using the automated installer - it’s a quick process, only
requiring you to agree to the license, choose the components (the default selection is usually fine)
and specify the installation directory.
Page 97
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Once FileZilla is installed, launch it and you’ll arrive at the main split-screen interface, one side for
your local directories and the other for remote directories.
To connect to the cloud server and deploy your application, follow these steps:
Page 98
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Use the "File → Site Manager → New Site" command to bring up the FileZilla Site
Manager, where you can set up a connection to your cloud server.
Enter your server host name or IP address and user name.
Select "SFTP" as the protocol and "Normal" as the logon type.
Page 99
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
Use the "Connect" button to connect to the cloud server and begin an SFTP session.
On the remote server side of the window, change to
the /opt/bitnami/apache2/htdocs directory
On the local server side of the window, change to the directory containing your
application code.
Upload your XAMPP application code to the remote directory by dragging and dropping
the files from the local server to the cloud server (you can back up the original contents
of the directory if you wish, by downloading them first).
Once the files are transferred, log in to the server console using PuTTY.
Create a database for the application using the MariaDB command-line client (you can
use phpMyAdmin if you prefer a graphical interface). For example, since the application
is a to-do list, let’s call the database 'tasks'.
mysql> CREATE DATABASE tasks;
Follow best practices and create a separate MariaDB user with privileges to access only
this database.
mysql> GRANT ALL ON tasks.* TO 'tasks'@'localhost' IDENTIFIED BY
'klio89';
Page 100
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
If required, update database credentials in your application. Then, install the application
schema in the new database (assuming you already uploaded it with the application
code). For example, you can use the following command with the MariaDB command-
line client:
shell>mysql -u tasks -D tasks -p < schema/tasks.sql
If you’re logged in to phpMyAdmin, you can also import the database schema from your local
XAMPP system. To do this, select the "Import" tab of the phpMyAdmin dashboard, select the file
containing the schema, and click "Go" to have the tables created in your selected database.
Page 101
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
You can also learn more about using phpMyAdmin to back up and restore databases.
Browse to your cloud server’s host name and your application should be active. Here are a few
screenshots of the example to-do list application running on the cloud server.
Page 102
Chaitanya Bharathi Institute of Technology ,Proddatur
ADVANCED WEB APPLICATION DEVELOPMENT MANUAL R20 III-I SEM
VIVA QUESTIONS
1. What is PHP?
2. How to create database connection and query in PHP?
3. Explain the difference b/w static and dynamic websites?
4. What is "echo" in PHP?
5. What is "print" in PHP?
6. What is the difference between "echo" and "print" in PHP?
7. How a variable is declared in PHP?
8. What are the ways to define a constant in PHP?
9. What are the ways to define a constant in PHP?
10. What is the array in PHP?
11. What is the array in PHP?
12. Explain some of the PHP string functions?
13. What are the methods to submit form in PHP?
14. What is a session?
15. What is $_SESSION in PHP?
16. What is the difference between session and cookie?
17. Write syntax to open a file in PHP?
18. How to delete file in PHP?
19. What are the different types of errors in PHP?
20. How to stop the execution of PHP script?
Page 103
Chaitanya Bharathi Institute of Technology ,Proddatur