What is server side programming ?
Explain the form processing using
VBSCRIPT and PERL ??
Server-Side Programming
Server-side programming refers to the code executed on a web
server, rather than in the user's browser. It is responsible for
processing user requests, accessing databases, executing
business logic, and generating dynamic content for the client.
Common server-side programming languages include PHP,
Python, Ruby, Java, C#, VBScript, Perl, and others.
Key responsibilities of server-side programming include:
Handling user input (e.g., form submissions).
Interacting with databases and other backend systems.
Generating HTML/CSS/JavaScript dynamically.
Implementing authentication and authorization.
Performing server-side validation.
Form Processing Using VBScript
VBScript (Visual Basic Scripting Edition) is a scripting language
developed by Microsoft, primarily used in Internet Explorer for
client-side scripting, but it can also be used for server-side
scripting in classic ASP (Active Server Pages).
Example: Simple Form Processing with VBScript:
Steps in VBScript Form Processing
1. User Submits a Form:
A user submits an HTML form, which sends data to the
server using either the GET or POST method.
2 . Retrieve Form Data in VBScript:
Use the Request object to capture form data
<%
' Retrieving form data using VBScript
Dim name, email
name = Request.Form("name")
email = Request.Form("email")
Response.Write("Name: " & name & "<br>Email: " & email)
%>
3. Validation and Processing:
Validate the inputs (e.g., check for empty fields).
Perform actions such as storing data in a database or
sending an email.
4. Generate Response:
· Return a response to the client based on the form
submission.
Form Processing Using Perl
Perl is a versatile programming language often used for CGI
(Common Gateway Interface) scripting in web applications. CGI
allows interaction between a web server and the Perl script.
Steps in Perl Form Processing
1. User Submits a Form:
The form sends data to a Perl CGI script on the server.
2. Retrieve Form Data in Perl:
Use the CGI module to parse form inputs.
#!/usr/bin/perl
use CGI;
my $cgi = CGI->new;
# Retrieve form data
my $name = $cgi->param('name');
my $email = $cgi->param('email');
print "Content-type: text/html\n\n";
print "<html><body>";
print "<h1>Form Data</h1>";
print "<p>Name: $name</p>";
print "<p>Email: $email</p>";
print "</body></html>";
3. Validation and Processing:
Validate inputs (e.g., check if fields are empty or improperly
formatted).
Store data in a file or database, or send an email.
4 Generate Response:
Output the HTML response back to the user.
1. Use the Request
capture form data
2.