Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Scripting languages document for lab, Lecture notes of Javascript programming

Find all details on scripting languages

Typology: Lecture notes

2020/2021

Uploaded on 11/19/2021

Neelakanta
Neelakanta 🇮🇳

1 document

1 / 92

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SCRIPTING LANGUAGES LAB (15A10705)
Department of IT SVCE Page 1
Week-1 Date:
1. Installation of IIS/WAMP/XAMPP/LAMP web server and configure apache
modules and php extensions.
Introduction:-XAMPP is a free and open source cross-platform web server solution
stack package developed by Apache Foundation, Consisting mainly of the Apache
HTTP Server, MySQL database and interpreters for scripts written in the PHP.
It is a simple, lightweight Apache distribution that makes it extremely easy
for developers to create a local web server for testing and deployment
purposes.
Services needed to set up a web server Server application (Apache),
Database (MySQL Database), and Scripting language (PHP).
XAMPP is also cross-platform, which means it works equally well on Linux,
Mac & Windows.
Windows web server deployments use the same components as XAMPP, it
makes transitioning from a local test server to a live server extremely easy as
well.
Xampp Server uses Open SSL [Secure Sockets Layer] support.
Xampp Server execution requires both Apache & MySQl Modules to be
Started.
Web Services run with Default URL(Uniform Resource Locator) address with
https://127.0.0.1 (or) https://localhost .
Xampp Services essentially require to configure with server details such as
Server- name, User-name, Password, Database .
System Requirements : Software Installations requires XAMPP Sever Software (
Open Source ) & Latest version of Web Browser (Google Chrome/Mozilla Firefox/
Internet Explore /Safari, etc.). In Addition to this hardware support is required with
free space of 1 Giga Byte is essential with sufficient dedicated RAM (Min 1GB) for
fast processing or execution.
In Windows Environment :- Steps for setting up Xampp Server and Execution.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c

Partial preview of the text

Download Scripting languages document for lab and more Lecture notes Javascript programming in PDF only on Docsity!

Week- 1 Date:

1. Installation of IIS/WAMP/XAMPP/LAMP web server and configure apache modules and php extensions. Introduction:- XAMPP is a free and open source cross-platform web server solution stack package developed by Apache Foundation, Consisting mainly of the Apache HTTP Server, MySQL database and interpreters for scripts written in the PHP.  It is a simple, lightweight Apache distribution that makes it extremely easy for developers to create a local web server for testing and deployment purposes.  Services needed to set up a web server – Server application (Apache), Database (MySQL Database), and Scripting language (PHP).  XAMPP is also cross-platform, which means it works equally well on Linux, Mac & Windows.  Windows web server deployments use the same components as XAMPP, it makes transitioning from a local test server to a live server extremely easy as well.  Xampp Server uses Open SSL [Secure Sockets Layer] support.  Xampp Server execution requires both Apache & MySQl Modules to be Started.  Web Services run with Default URL(Uniform Resource Locator) address with https://127.0.0.1 (or) https://localhost.  Xampp Services essentially require to configure with server details such as Server- name, User-name, Password, Database. System Requirements : Software Installations requires XAMPP Sever Software ( Open Source ) & Latest version of Web Browser (Google Chrome/Mozilla Firefox/ Internet Explore /Safari, etc.). In Addition to this hardware support is required with free space of 1 Giga Byte is essential with sufficient dedicated RAM (Min 1GB) for fast processing or execution. In Windows Environment :- Steps for setting up Xampp Server and Execution.

Step 1 :- Run Xampp Server Software (Open Source Software ) from local drive. Step 2 :- Click on Next to Continue installation Process.

Step 5 :- Installation Process continues. Step 6 :- Click on Finish to complete Setup.

Step 7 :- After Installation , Open Local Disk [ Where Xampp is Installed ] & find Xampp Folder [While extraction of server files, where installation is carried out ]. Step 8 :- Open Xampp Folder & Click on Xampp Control icon.

Step 11 :- Click on Start to Run MySQL Server Engine/Module. Step 12 :- Open htdocs folder.

Step 13 :- Create a New Folder with desired name or Roll number [ Ex :- Rollnumber ] Here we save all PHP programs, To execute or Run on Server. Step 14 :- Open a Text Document & write sample PHP program and save file with desired filename with Extension of .php [Example :- addition.php ] & Choose All Files while Saving at Save as Type.

Step 17 :- Choose Tool phpMyAdmin to visit MySQL Database Step 18 :- MySQL Database

Step 19 :- To execute programs, Open Web Browser and type url as localhost/folder name [ Ex:- localhost/jeevan ]. where all the programs saved in directory will display, Click on filename.php to execute. [ Ex:- addition.php ]. Step 20 :- Sample output for addition.php program.

PHP - The if…else Statement. if...else statement - executes some code if a condition is true and another code if that condition is false Syntax if ( condition ) { code to be executed if condition is true; } else { code to be executed if condition is false; } Source Code :-

**Output:-** For Value 75, You have Passed [ Default ] For Value 35, You have Failed For Value 85, You have Passed **Result:-** Hence the program executed successfully.

PHP - The if…elseis…else Statement. if...elseif....else statement - executes different codes for more than two conditions Syntax if ( condition ) { code to be executed if this condition is true; } elseif ( condition ) { code to be executed if this condition is true; } else { code to be executed if all conditions are false; } Source Code :-

**Output:-** For Value 35, Sorry! you have Failed [ Default ] For Value 55, Congts! You have Passed in Second Class For Value 85, Congts! You have Passed in First Class **Result:-** Hence the program executed successfully.

default: echo "Your favorite color is neither red, blue, nor green!"; } ?> Output:- For empty Value Your favorite color is neither red, blue, nor green! [Default] For Value red, Your favorite color is red! [Default] For Value blue, Your favorite color is blue! For Value green, Your favorite color is green! Result:- Hence the program executed successfully.

2(b). Write a PHP program to illustrate the use of Looping Statements. Aim:- To write a PHP program to execute Looping statements. Program description:-while - loops through a block of code as long as the specified condition is true  do...while - loops through a block of code once, and then repeats the loop as long as the specified condition is true  for - loops through a block of code a specified number of times  foreach - loops through a block of code for each element in an array  PHP – The while Statement. while - loops through a block of code as long as the specified condition is true Syntax:- while ( condition is true ) { code to be executed ; } Source Code:-

"; $x++; } ?> **Output:-** The number is: 1 , The number is: 2 ,The number is: 3 **Result:-** Hence the program executed successfully.

PHP – For Loop. for - loops through a block of code a specified number of times Syntax:- for ( init counter; test counter; increment counter ) { code to be executed; } Source Code:-

"; } ?> **Output:-** The number is: 1 The number is: 2 The number is: 3 The number is: 4 The number is: 5 **Result:-** Hence the program executed successfully.

PHP – For-Each Loop. foreach - loops through a block of code for each element in an array Syntax:- foreach ($ array as $ value ) { code to be executed; } Source Code:-

"; } ?> **Output:-** Red Green Blue Yellow **Result:-** Hence the program executed successfully.