Beyond the EU: DORA and NIS 2 Directive's Global Impact
LAMP_TRAINING_SESSION_7
1.
2. Server Side Scripting Language for Dynamic Web Page Development
Open Source
Supports Large Number of Databases
It can work as Server Module or as Stand Alone CGI Script
3. Resembles C, C++ and Perl
HTTP Authentication
Cookies
Sessions
File Uploads
Remote File Handling
Persistent Database Connections
Command Line Interpretation
Portable Code
4.
5. + H OOR : R U OG
KWPO!
KH D G !
WL WOH !3 + 3 7 U D L Q L Q J WL WOH !
KH D G !
E R G E J F R OR U ) ) ) ) !
E R G !
KWPO!
6. The Server Time Now 15:44:31
KWPO!
KH D G !
WL WOH !3 + 3 7 U D L Q L Q J WL WOH !
KH D G !
E R G E J F R OR U ) ) ) ) !
! quot;$ % '!
#%
#
E R G !
KWPO!
7. Welcome Trainees
KWPO!
KH D G !
WL WOH !3 + 3 7 U D L Q L Q J WL WOH !
KH D G !
E R G E J F R OR U ) ) ) ) !
( ) (*+, - )
# .
/quot;( ) 0 #'
1
2
( ) 2
3
I R U P PH WKR G S R V W!
S D OL J Q F H Q WH U ! ( Q WH U R X U 1 D PH
L Q S X W W S H WH [ W Q D PH P Q D PH ! S !
I R U P!
E R G !
KWPO!
12. ! quot; #
)
4,,9 ;
: ( =:
/ ( # +
+
( ? +
+ 2
/ /
: ( @ A
B ,;
9 ( A CD
A E
( ,F @ 7
G ; :
7 H )
; $
; ( ) # H!
quot;) ! '
( )quot; 9 H !E
F ; ! I) J9! + + '
,4 :
K7 ( I) quot;
7 '
)
,= :
: 7 ( ) L *L
H )?
quot; 8 MC M 2'
=99 ( H
13. quot; $
, ( ) quot;( '
( ?E G
N 2 E G
N
/
( O D P
E Q / :
:
( QQ ECP B ,;
9
( ( C?R2 ECPR
/
14.
15. % #
S M S )
( S
( P S
(P / H
( * S
(* / =
( T S
( U / /
; 7 /7 QV E@
( / S M : S 6
: :
16.
17. ' # #
S M S )
6 quot; ! Q' S
6 quot; E!2 W''' 2' S
S E G
N / ) F
6 quot;# !B 9:
; ' S
6 quot;E ! Q' / H
6 quot;* *! Q' S
6 quot;# Q
!P ' / ;
6 quot;**9 :
/ **! '
=: / I 7 : S 6
: :
18.
19. (quot; #
; ,
, :F H
U
O
U !
8 quot; # $
!% ' %
R quot; ( ) %
20. (quot; #
;
,
, :F H
*
O + %
U + %
8 # + % #
+ %
R ( + % (
C , + % ,
29. ' +
while ($x10)
{
echo “The Value of X is u$x/u now br”;
$x++;
}
while ($x10):
echo “The Value of X is u$x/u now br”;
$x++;
endwhile;
30. ' , - .
do
{
echo “The Value of X is u$x/u now br”;
$x++;
} while ($x=10)
31. ' *
For($x=1; $x=10;$x++)
{
echo “The Value of X is u$x/u now br”;
}
For($x=1; ;$x++)
{
echo “The Value of X is u$x/u now br”;
If($x==10)break;
}
For(;;)
{
$x++; if($x10)break;
echo “The Value of X is u$x/u now br”;
}
32. ' *
For($x=1; $x=10;$x++):
echo “The Value of X is u$x/u now br”;
endfor;
For($x=1; ;$x++):
echo “The Value of X is u$x/u now br”;
If($x==10)break;
endfor;
For(;;):
$x++; if($x10)break;
echo “The Value of X is u$x/u now br”;
endfor;
33. ' *
$x = array (1,2,3,4,5,6,7,8,9,10);
foreach($x as $v)
{
echo “The Value of X is u$v/u now br”;
}
$x = array (“one”=1,”two”=2,”three”=3,”four”=4,”five”=5,
“six”=6,”seven”=7,”eight”=8,”nine”=9,”ten”=10);
foreach($x as $p=$v)
{
echo “The Value of $p is u$v/u now br”;
}
35. '
$i = 0;
while ($i++ 5)
{
echo “I am in Outer Zone brquot;;
while (TRUE)
{
echo “Now in Middle Zone brquot;;
while (TRUE)
{
echo “Now in Inner Zone brquot;;
echo “-----------------------------------($i)br”;
continue 3;
}
echo quot;This never gets outputquot;;
}
echo quot;Neither does thisquot;;
}
36. ' #.
Switch ($x)
{
case 1:
echo “Value of X is 1 br“;
break;
case 2:
echo “Value of X is 2 br“;
break;
case 3:
echo “Value of X is 3 br“;
break;
case 4:
case 5:
echo “Value of X is 4 br“;
break;
default:
echo “Value of X is $x br”;
}
37. ' 0 123 , 12
require ‘conf.php’;
require $conffile;
require (“conf,php”);
include ‘conf.php’;
include $conffile;
include (“conf,php”);
40. 5# 6 * ,7 #
function hellow($x,$y=“, How are You?”)
{
echo “Hello $x $y br”;
}
hellow(‘Sir’);
hellow(‘Arjun’,’When Did You Come?’);
hellow(‘Ram’,’’);
Hello Sir, How are You?
Hello Arjun When Did You Come?
Hello Ram
44. ' ##
class LAMP
{
var $strength=0; var $trainee;
function Add_Trainee($name,$designation)
{
$this-strength++;
$this-trainee[$this-strength]['id']=$this-strength;
$this-trainee[$this-strength]['name']=$name;
$this-trainee[$this-strength]['designation']=$designation;
}
}
$Session1 = new LAMP;
$Session1-Add_Trainee('Loo','SDE');$Session1-Add_Trainee('Goo','JTO');
for($n=0; $n=$Session1-strength; $n++)
{
echo $Session1-trainee[$n]['id'], “...quot;, $Session1-trainee[$n]['name'],
quot;...quot;, $Session1-trainee[$n]['designation'], quot;brquot;;
}
1...Loo...SDE
2...Goo...JTO
45. ' ## 8 )
class A
{
function X() {echo quot;I am From Function X of Class A brquot;;}
}
class B extends A
{
function Y() { echo quot;I am From Function Y of Class B brquot;;}
}
$var = new B;
echo $var-X();
echo $var-Y();
I am From Function X of Class A
I am From Function Y of Class B
46.
47. 9 7 #
; $
; *7 = _
) )* H 5quot; ) H! ` - M
! *5 ) .'
( ) )* quot;
H 5( )N
! ! '
=:
; $ : *: /
; *_ $
M )*5 ) F quot;
* F 5)! ) '
( 5 ) *
*5 ) F #
quot; ! ( H '
; $
; * ; _
9
M )* 5quot; )X )! M 5 H -! F H .'
)* quot;
5 ( H !#
+ S H '
,
M quot; )X )-! * '
.
quot; H
( '
49. 7 ## 7 #
7 $
,+
M )quot; H ! '
!quot;
( )#
quot; C ! C '
B :
,+
H quot; ! -M
!
H * H * -! H
F. '
.
#
( quot;a H C F a aa
! '
; /:
: 6B 9
quot; -M
! H *
H * -! H F. '
.
$
quot; )
# C F '
= 9 _
/
M H 5quot; -! H F .'
%
= 5# )
quot; C F '
50. : 7 #
J
L quot; '
quot; '
( quot; '
L (F
+,
H M quot; H M M ! H M F '
$
( quot; !N
(F '
;
quot; '
( quot;Q
N '
6
;
quot;- ! F '
.
$
( quot;! Q Q
Q '
51. : ; 7 #
I$ J9 ,
*7 :7
H ) L*
quot;- -
! H -
! -!
M * 5-! * .. '
...
# quot;( !
( F ) L*
quot;# ! ! A Q c'
I$ J9 ,
*:
) L*
quot;- H 5* .'
quot;( ! ) *+
* ,
) L*
quot;( F'
I$ J9 : : *64
* 97
M ) L *
* Mquot; M * -! H 5* .'
quot; $ *
) L *
* M # L'
quot;
I$ J9*J=: $
H ) L *L
H )quot; LH )-! H 5* .'
quot;( !
( ) L *L
H )#
quot; 8 C H '
52. = 7 #
: :
7
F quot; -! )X H H -! X H * . '
.
F quot;# '
+; =
Hquot; -! X H * .'
H ?V 2
quot; '
53. 7 #
: ,
7
quot; -
! CCC.'
#
? H
$ ?! (
: + ,6:
9
) F quot; ! -! .'
quot;
( ) ) F quot; !2! (9
? '
:
9
quot; '
quot; H
? 2'
=4
M
H quot; ! -! .'
$
( M quot; H
H ? 2 !@
!c '
54.
55. 95 = ) ) + )
'9 (
?php
if (!isset($_SERVER['PHP_AUTH_USER']))
{
header('WWW-Authenticate: Basic realm=“Protectedquot;');
header('HTTP/1.0 401 Unauthorized');
echo ‘You Should Login to View the Content';
exit;
} else {
echo quot;pHello {$_SERVER['PHP_AUTH_USER']}./pquot;;
echo quot;pYou entered {$_SERVER['PHP_AUTH_PW']} as your
password./pquot;;
}
?
58. 7 ,
html
body
form method=post
p align=center Enter Your Name nbsp nbsp input type=text
name=mynamebr
input type=submit name=button value=Process
input type=hidden name=hiddenfield value=100
/p
?php
$button = $_POST['button'];
If($button!='')
{
$name = $_POST['myname'];
$hidden_value = $_POST['hiddenfield'];
$shrink = strlen($name);
echo quot;Your name b$name/b is of $shrink Character Length.
brquot;;
echo quot;Your Hidden Field Value is quot;, $hidden_value;
}
?
/body
/html