Chapter 2-Server Side Programming
Chapter 2-Server Side Programming
Chapter 2-Server Side Programming
Server-side programming
What is server side PL?
❑ It is a technique used in web development which involves
employing scripts on a web server which produce a response
for each user's request to the website.
❑ It provides an interface to the user and is used to limit access
to proprietary data and help keep control of the script source
code.
❑ Server-side processing is used to interact with permanent
storage like databases or files.
❑ Examples: Java, JavaScript using Server-side JavaScript
(SSJS), Perl, PHP
D/ce b/n server-side and client-side PL
Client-side programming Server-side programming
web browser running on the user’s local web server software (e.g. Apache) that runs
machine. on server hardware.
processing takes place on the end users user's request is fulfilled by running a script
computer. directly on the web server
interface to user and links to server-side interface to databases or other data stores on
language the server
Access data from server-side Access data directly from database sources
❑ echo or echo().
❑ print or print().
Using echo and print
Example: using echo
<?php
echo "<h2>PHP is fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This", " string", " was", " made", " with multiple
parameters.";
?>
Example: using print
<?php
print "<h2>PHP is fun!</h2>";
print "Hello world!<br>";
print "I'm about to learn PHP!";
?>
Comments
$s2 = 'world!';
(A and B) is true.
(A or B) is true.
(A || B) is true.
• C += A is equivalent to C = C + A
• C -= A is equivalent to C = C - A
• C *= A is equivalent to C = C * A
• C /= A is equivalent to C = C / A
• C %= A is equivalent to C = C % A
5. Conditional Operator
❑ Install PHP