0% found this document useful (0 votes)
133 views

PHP Syllabus

This document outlines the topics and contents of a 6th semester B.Sc. Physical Science/Mathematical Science course on PHP programming. The course covers introduction to web application development, basics of PHP programming including variables, operators, and decision making. It also covers modular programming with functions and objects, strings and arrays, forms and form processing, and integrating PHP with databases. Twenty one practical programming assignments are listed related to conditions, loops, functions, strings, arrays, and databases. References for the textbook and additional resources are also provided.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

PHP Syllabus

This document outlines the topics and contents of a 6th semester B.Sc. Physical Science/Mathematical Science course on PHP programming. The course covers introduction to web application development, basics of PHP programming including variables, operators, and decision making. It also covers modular programming with functions and objects, strings and arrays, forms and form processing, and integrating PHP with databases. Twenty one practical programming assignments are listed related to conditions, loops, functions, strings, arrays, and databases. References for the textbook and additional resources are also provided.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

B.Sc.

Physical Science/Mathematical Science VIth Semester SEC


BSCS10B: PHP Programming

Topic Contents of Book Reference


Unit 1 - Introduction: Introduction Chapter 1, 2 (Only LAMP, XAMP [1]
to three tier web application and MAMP)
development, front end, business
layer and back end connectivity, role https://en.wikipedia.org/wiki/M
of PHP in web application ultitier_architecture
development, software requirements.
Unit 2 - Starting PHP Chapter 3 (till [1]
Programming: Basics of PHP global variables))
programming, variables, scope of a
variable, expressions, operators, Chapter 4 ((till implicit
operator precedence, simple and explicit casting))
procedural scripts, decision making
based on conditions, case structure,
loops.
Unit 3 - Modular Programming: Chapter 5 ( pg 95-109) [1]
Functions and objects, Passing
parameters.
Unit 4 - Strings and Arrays: Chapter 6 (pg 123-128, 132-136) [1]
Creating and accessing strings, from [1]
built-in functions for string and [2]
string formatting, creating index Chapter 4(till pg 124) from [2]
based and associative array,
accessing array elements.
Unit 5 - Forms and form Chapter 11 (till page 283) [1] [1]
processing: Capturing form data,
GET and POST form methods, Chapter 4( pg 124-130) from [2] [2]
processing of form data, and use of
regular expressions.
Unit 6 - Integrating PHP & Chapter 10 (pg 234, 235, [1]
DBMS: Connecting PHP and 248-252)
DBMS, creating database, defining
database structure and accessing data
stored in tables using PHP.

1
References:

[1] Nixon, R. (2014). Learning PHP, MySQL, JavaScript, CSS & HTML5. 4th Edition, O'reilly.

[2] Welling, L., Thompson, L. (2008). PHP and MySQL Web Development. 4th Edition, Addison-
Wesley Professional.

Additional Resources:

1. Boronczyk, T., & Psinas, M. E. (2008). PHP and MYSQL (Create-Modify-Reuse).

Wiley India Private Limited.

2. Holzner, S. (2007). PHP: The Complete Reference. McGraw Hill Education (India).

3. Sklar, D., & Trachtenberg, A. (2014). PHP Cookbook: Solutions & Examples for PHP
Programmers. O'Reilly Media.

List of Practicals:

(Use HTML forms for accepting input from user)

1) Write a PHP script to input three numbers and print the largest number.
2) Write a PHP code which accepts a number (from 1-12) as month value and displays the
number of days in that month. (Use Switch case).
3) Using switch case and dropdown list display a “Hello” message depending on the
language selected in the drop-down list.
4) Write a PHP script to find the sum of first n odd numbers.
5) Write a PHP script to check whether the given number is prime or not.
6) Write a PHP script to construct the following pattern, using nested for loop:
*
**
***
****
*****
7) Write a function to calculate the factorial of a number (non-negative integer), which accepts
the number as an argument.
8) Write a PHP script to accept a string from the user and print its reverse as output.
9) Write a PHP script to compare two variables using equality operator and identity operator.

2
10) Write a script to check if the input string consists of lowercase characters only.
11) Write a PHP script that checks if a string contains another string.
12) Write a PHP script to remove whitespaces from a string.
Sample string : The quick brown fox
Expected Output : Thequickbrownfox
13) Write a PHP script to replace the first ‘the’ of the following string with
‘That’. Sample : ‘the quick brown fox jumps over the lazy dog’.
Expected Output : ‘That quick brown fox jumps over the lazy dog’.
14) Write a PHP script to check whether a string is palindrome or not? (A palindrome is word,
phrase, or sequence that reads the same backward as forward, e.g., madam or nursesrun)
15) WAP to sort an array of numbers.
16) Create an array using a PHP script. Display the elements of this array in the form of a
bulleted list.

Sample: $color = array(‘white’, ‘green’, ‘red’).

Expected Output : • white


• green
• red

17) Write a PHP code which creates an array of 5 names. Display the names which start
with character “A”.
18) Create an associative array to store marks in five subjects of a student, where key is subject
name and value is marks in the subject. Display all keys and values. Also sort the array on
the basis of the key.
19) Write a PHP script to explode a string delimited with ## into an array. Print each element of
this array in the form of Array[index]= element.
Sample String: hello ## this ## is ## php ## programming
Expected Output: Array[0]=hello
Array[1]= this
Array[2]= is
Array[3]= php
Array[4]= programming
20) Create an HTML form with input elements: Name, Age, Address, Email and a submit button.

Write PHP scripts to perform following validations:


a. Name, Age, Address should not be left blank
b. Age should be greater than 18
c. Address should contain “Delhi”
d. Check whether the email entered is valid or not.
21) Write PHP scripts to
a. Create a database “CollegeWebsite”
b. create a table “User(username varchar(120), password varchar(10))” within
database “CollegeWebsite”.
c. Create a login page, which asks the user for a username and password. On clicking
submit, a welcome message should be displayed if the user is already registered (i.e.
name is present in the database) otherwise an error message should be displayed.

You might also like