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

Training Report & Presentation: Yashika Garg 1003313059 C.S.E. Vii Sem

The training report summarizes a training that Yashika Garg completed at CMC Limited, a Tata Enterprise IT company. The training covered topics including PHP, variables, constants, data types, arrays, cookies, sessions, working with databases, and file handling. Yashika also described a tourism website project built with PHP and Joomla that allows users to view information about tourism locations in India and send queries to administrators.

Uploaded by

Yashika Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Training Report & Presentation: Yashika Garg 1003313059 C.S.E. Vii Sem

The training report summarizes a training that Yashika Garg completed at CMC Limited, a Tata Enterprise IT company. The training covered topics including PHP, variables, constants, data types, arrays, cookies, sessions, working with databases, and file handling. Yashika also described a tourism website project built with PHP and Joomla that allows users to view information about tourism locations in India and send queries to administrators.

Uploaded by

Yashika Garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 41

TRAINING REPORT

& PRESENTATION
DONE AT:
CMC LIMITED
(NOIDA)
SUBMITTED BY:

YASHIKA GARG
1003313059
C.S.E.
VII SEM
About the company..
 CMC Limited a Tata Enterprise is a premier information
technology company with an all India presence having ISO
9001-2000 certification for its R&D center & System
Integration (NR group).

 CMC Limited has been conducting computer-training


program for various organizations since 1978.

 Large and complex project management capabilities


since its incorporation in 1975, CMC has an enviable record of
successfully building IT solutions for massive and complex
infrastructure and market projects.
About php
 PHP, a recursive acronym for PHP Hypertext Preprocessor.
OTHERS NAMES :- Personal Home Page, Professional Home Page

 It is a simple and powerful server-site scripting language designed for


creating
dynamic web pages.

 Much of its syntax is borrowed from C, Java and Perl with couple of
unique
PHP specific features thrown in.

 The main goal of this language is to allow web developers to write


dynamically
web pages quickly.
Advantages of php
 Open source
 Cross platform
 Easy to use
 Cost benefits
 File handling
 C type language
 Extensible
 Compatibility
 Internet application
Php variables
A variable is special container that you
can define to “hold” a value. The
variables in PHP are declared by
appending the $ variables sign to the
variable name.
For e.g
$company = “CMC”;
$sum = 10.0;
Php constants
A constant is an identifier (name) for a simple
value. As the name suggests, that value
cannot change during the execution of the
script.
 Constants are defined in PHP by using
the define() function.
For e.g.
define(“CMC”, “welcome to cmc”)
 define() function says whether the
constant exists or not.
Php data types
 Simple
- integer
- double
- boolean
- string
- unary
- binary
 Compound
- array
- object
 Special
- resource
- null
PHP Arrays
WHAT IS AN ARRAY..?

-An array can store one or more values in a


single variable name.

-Each element in the array is assigned its own


ID so that it can be easily accessed.
-$array[key] = value;
3 Kinds of Arrays

1) Numeric Array
2) Associative Array
3) Multidimensional Array
Maintaining State in PHP
Part I - Cookies
 A cookie is a small text file that is stored on a user’s
computer.

 Each cookie on the user’s computer is connected to a


particular domain.

 Each cookie be used to store up to 4kB of data.

 A maximum of 20 cookies can be stored on a user’s PC


per domain
Set a cookie
setcookie(name [,value [,expire [,path [,domain
[,secure]]]]])

name = cookie name


value = data to store (string)
expire = UNIX timestamp when the cookie expires.
Default is that cookie expires when browser is
closed.
path = Path on the server within and below which the
cookie is available on.
domain = Domain at which the cookie is available
for.
secure = If cookie should be sent over HTTPS
connection only. Default false.
Read cookie data
All cookie data is available through the superglobal
$_COOKIE:
$variable = $_COOKIE[‘cookie_name’]
or
$variable = $HTTP_COOKIE_VARS[‘cookie_name’];
e.g.
$age = $_COOKIE[‘age’]
Maintaining State in PHP
Part II - Sessions
How do ‘Sessions’ work?
They are based on assigning each user a unique
number, or session id. Even for extremely heavy
use sites, this number can for all practical purposes
can be regarded as unique.
e.g.
26fe536a534d3c7cde4297abb45e275a
Starting or Resuming a
Session
session_start();
PHP does all the work: It looks for a valid
session id in the $_COOKIE or $_GET super
globals – if found it initializes the data. If none
found, a new session id is created. Note that like
setcookie(), this function must be called
before any echoed output to browser.
Working with database
PHP MySQL Connect to a Database

1) Mysql_connect:-it is used to create connection with


database
Mysql_connect(“servername”,”username”,”password”)
mysql_connect(“localhost”,”root”,””);
Ex:-
<?php
$con = mysql_connect (“localhost”,”root”,””);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
?>
Closing a Connection
The connection will be closed automatically
when the script ends. To close the connection
before, use the mysql_close() function:
<?php
$con =
mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
mysql_close($con);
?>
Create a Database
The CREATE DATABASE statement is used to create a
database in MySQL.
Syntax
CREATE DATABASE database_name

Mysql_select_db(“database name”);
Files and PHP
File Handling
Data Storage
 Though slower than a database
Manipulating uploaded files
 From forms
Creating Files for download
Open/Close a File
A file is opened with fopen() as a “stream”, and PHP
returns a ‘handle’ to the file that can be used to
reference the open file in other functions.
Each file is opened in a particular mode.
A file is closed with fclose() or when your script ends.
File Open Modes
‘r’ Open for reading only. Start at beginning of
file.
‘r+’ Open for reading and writing. Start at
beginning of file.
‘w’ Open for writing only. Remove all previous
content, if file doesn’t exist, create it.
‘a’ Open writing, but start at END of current
content.
‘a+’ Open for reading and writing, start at END
and create file if necessary.
About the project
Name- TOURISM SITE (travelyatri.com)
Description- it is a tourism site developed in
PHP language and the front end has been
developed using JOOMLA content
management system. The site is all about
different tourism places in India and helps the
visitors to easily have the knowledge of all the
locations and let the visitors know about any
of the location also by sending a query
message to the admin along with their email
id.
Modules used -
1. Admin module
- setting management
> admin setting
- cms management
> about us
> contact us
> privacy pocily
> faq
> help
- data management
> location management
> state management
> query messages.
Continues..
2. FRONT END ( travelyatri.com )
- home
- about us
- maps
- contact us

You might also like