Web Server Management System - Programming

Verified

Added on  2022/08/18

|15
|1649
|15
AI Summary
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: WEB SERVER AND PROGRAMING
Web server and programing
Name of the Author
Name of the University
Author Note
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1Web Server management system
Table of Contents
1.HTTP including Request/Response Methods...............................................................................2
Request Methods.........................................................................................................................2
Response methods.......................................................................................................................3
Session management and stateless programming............................................................................4
State management........................................................................................................................5
Programming control structures......................................................................................................5
Object-oriented programming including classes and objects..........................................................6
Object...........................................................................................................................................6
Class.............................................................................................................................................6
Authentication and web security.....................................................................................................8
Document Page
2Web Server management system
1.HTTP including Request/Response Methods
HTTP Request Methods
HTTP methods provides a set of request methods in the browser. This methods located to the
desire action and performed for a given resource. Sometime HTTP request methods referred to
as HTTP verb . Request methods are case sensitive. This methods always mention in an upper
case.
GET Method
To retrieve the information using a GET method to the form and giving server information using
a given URI.
Request methods using a GET methods to retrieve a data in a form and no other effect in this
data.
HEAD Method
To retrieve the information using a HEAD method to the form and given the server using a given
URI this method same as GET method, but this method move the status line and work only the
browser header section.
POST Method
Any data send in the server to use the POST request method
PUT
PUT method used to replace all the current representation and resource the uploaded content.
DELETE
Document Page
3Web Server management system
The DELETE method used to remove all the current representation.
CONNECT
CONNECT method used to tunnel the browser identified by a URI.
Response methods
After receiving a request message, Server response with a HTTP response message.
In this example displaying error condition when the HTTP web server couldn’t find the
requested page:
HTTP/1.1 404 Not Found
Date: Sun, 18 Oct 2012 10:36:20 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 230
Connection: Closed
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4Web Server management system
<p>The requested URL /t.html was not found on this server.</p>
</body>
</html>
2. Session management and stateless programming
HTTP protocol
HTTP is stateless protocol. Session are used to implement client server application that are more
complex and flexible. Session identification to the every request in the client side server.
HTML Forms
Browser send the all data to the HTML form with a GET or POST request method. Server send
the data including a form and store a data in a form fields. Form field are not visible in the
browser but seen the source HTML code in this field. This information sent back to the server
with GET or POST of the form.
HTML Links
Also possible to generate a HTML link .This simply attached to the Request in a GET request
method.
Cookies
Server store a data in small text fields (Cookies) and the browser sending them in the header of a
response. Cookie is an additional information in the server. Client used the same cookie name in
the same form these time the older cookie name is replaced. Cookie use for collect user data and
create user profile details.
Document Page
5Web Server management system
Cookie example
Cookie ck=new Cookie("user","sonoo jaiswal");//creating cookie object
response.addCookie(ck);//adding cookie in the response
Session example:
<?php
//Startthesession
session_start();
?>
<!DOCTYPEhtml>
<html>
<body>
<?php
//Setsessionvariables
$_SESSION["favcolor"]="green";
$_SESSION["favanimal"]="cat";
echo"Sessionvariablesareset.";
?>
</body>
</html>
Document Page
6Web Server management system
State management system
State management system in the server side
State management system in the server side used to storing the user information data on the
server. Server side information is available on the every webpage.
State management system in the client side
State management system in the client side used to storing the specific user information in the
client side browser. This server side information also seen on the web application.
3. Programming control structures
Programing control structure is a block part of the programing. This part analyse a variables and
choose a direction based on given parameters.
There are three control structures in this structured programing.
SEQUENCE:
Sequence is a part of control structures. This structures used to line by line execution.
DECISION:
Decision is a second part of the control structures. This structure use to one set of statement to be
executed.
LOOP:
Loop is a 3rd part of the control structures. This statement use to allow block statement multiple
time to specified condition are met.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7Web Server management system
4.Object-oriented programming including classes and objects
Object oriented programing are used to classes and object
Object
The object oriented class behind the object oriented programing language is to enclose variable
and function into a one object. In this behind together function and data are called encapsulation.
This feature easy to make a code in various programing language. Object provides a way to
access various data. The object used to call a method and the method of an object access to
variable called properties.
Class
Class is a constructor.
Class is use to object oriented programing. The object is created a class and the created class
maintain the state behaviour of the class member.
Example :
<?php
class Myclass
{
// Add property statements here
// Add the methods here
}
?>
Document Page
8Web Server management system
The new word used to instantiate of an object
<?php
$myobj = new MyClass;
?>
My class using a var_dump () function
<?php
class Myclass
{
// Add property statements here
// Add the methods here
}
$myobj = new MyClass;
var_dump($myobj);
?>
Output
object(Myclass)#1 (0) { }
Document Page
9Web Server management system
5. Authentication and web security
The authentication process is used for web security purposes. If a person or the device is genuine
to verify this authentication process is helpful. When a user is a login by login id and login
password then user’s details store in the database and checked if the user enters wrong id and
password then authentication is wrong and a message will be shown.
Example:
<?php
include("config.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from form
$myusername = mysqli_real_escape_string($db,$_POST['username']);
$mypassword = mysqli_real_escape_string($db,$_POST['password']);
$sql = "SELECT id FROM admin WHERE username = '$myusername' and passcode =
'$mypassword'";
$result = mysqli_query($db,$sql);
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
10Web Server management system
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$active = $row['active'];
$count = mysqli_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count == 1) {
session_register("myusername");
$_SESSION['login_user'] = $myusername;
header("location: welcome.php");
}else {
$error = "Your Login Name or Password is invalid";
}
}
?>
<html>
Document Page
11Web Server management system
<head>
<title>Login Page</title>
<style type = "text/css">
body {
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
}
label {
font-weight:bold;
width:100px;
font-size:14px;
}
.box {
border:#666666 solid 1px;
}
</style>
Document Page
12Web Server management system
</head>
<body bgcolor = "#FFFFFF">
<div align = "center">
<div style = "width:300px; border: solid 1px #333333; " align = "left">
<div style = "background-color:#333333; color:#FFFFFF;
padding:3px;"><b>Login</b></div>
<div style = "margin:30px">
<form action = "" method = "post">
<label>UserName :</label><input type = "text" name = "username" class =
"box"/><br /><br />
<label>Password :</label><input type = "password" name = "password" class =
"box" /><br/><br />
<input type = "submit" value = " Submit "/><br />
</form>
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
13Web Server management system
<div style = "font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error; ?
></div>
</div>
</div>
</div>
</body>
</html>
.
Document Page
14Web Server management system
chevron_up_icon
1 out of 15
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]