ABOUT oracle
The Oracle Corporation is an American global computer technology corporation, headquartered in Redwood City,California. The company primarily specializes in developing and marketing computer hardware systems and enterprise software products – particularly its own brands of database management systems. In 2011 Oracle was the second-largest software maker by revenue, after Microsoft.
The company also develops and builds tools for database development and systems of middle-tier software, enterprise resource planning(ERP) software, customer relationship management(CRM) software and supply chain management(SCM) software.
Oracle Corp. was founded by Larry Ellison in 1977 with the help of Bob Miner and Ed Oates under name Software Development Laboratories (SDL) in Santa Clara,California.
Products and services
Oracle designs, manufactures, and sells both software and hardware products, as well as offers services complementing them (such as financing, training, consulting, and hosting services). Many of the products have been added to Oracle’s portfolio through acquisitions.
Software
1. DATABASES
- Oracle Database
In 2004, Oracle Corporation shipped release 10g (g standing for “grid”) as the latest version of Oracle Database. (Oracle Application Server 10g using JavaEE integrates with the server part of that version of the database, making it possible to deploy web-technology applications. The application server comprises the first middle tier software designed for grid computing. The interrelationship between Oracle 10g and Java allows developers to set up stored procedures written in the Java language, as well as those written in the traditional Oracle database programming language,PL/SQL) – Release 11g became the current Oracle Database version in 2007. Oracle Database 11g Release 2 was released in September 2009. This version is available in four commercial editions – Enterprise Edition, Standard Edition, Standard Edition One, Personal Edition – and one free edition – the Express Edition. The licensing of these editions shows various restrictions and obligations that are considered complex. The Enterprise Edition (DB EE), as it is the most expensive of the Database Editions, has the least restrictions – but nevertheless has a complex licensing. The Standard Edition (DB SE) and Standard Edition One (SE1), are constrained by more licensing restrictions, which reflects their lower price. Release 12c has been made available on the first of July 2013.
The following are additional database technologies that have been acquired and developed by the Oracle Corporation:
- Berkeley DB offers embedded database processing.
- Oracle Rdb, a relational database system, runs on OpenVMS platforms. Oracle acquired Rdb in 1994 from Digital Equipment Corporation. Oracle has since made many enhancements to this product and development continues today.
- TimesTen features in-memory database operations.
- Oracle Essbase continues the Hyperion Essbase tradition of multi-dimensional database management.
- MySQL, a relational database management system licensed under the GNU General Public License, initially developed by MySQLAB.
- Oracle NoSQL Database, a scalable, distributed key-value NoSQL database.
2. MIDDLEWARE
Oracle Fusion Middleware is a family of middleware software products, including for instance application server,system integration, business process management(BPM), user interaction, content management, identity management and business intelligence(BI) products.
Oracle Secure Enterprise Search
Oracle Secure Enterprise Search (SES), Oracle’s enterprise-search , gives users the ability to search for content across multiple locations, including websites, file servers, content management systems, enterprise resource planning systems, customer relationship management systems, business intelligence systems and databases.
Oracle Beehive
Released in 2008, the Oracle Beehive collaboration software provides team workspaces (including wikis, team calendaring and file sharing), email, calendar, instant messaging, and conferencing on a single platform. Customers can use Beehive as licensed software or as software as a service(“SaaS”).
3. APPLICATIONS
Oracle also sells a suite of business applications. The Oracle E-Business Suite includes software to perform various enterprise functions related to, for instance, financials, manufacturing, customer relationship management(CRM), enterprise resource planning(ERP) and human resource management. The Oracle Retail Suite covers the retail-industry vertical, providing merchandise management, price management, invoice matching, allocations, store operations management, warehouse management, demand forecasting, merchandise financial planning, assortment planning and category management. Users can access these facilities through a browser interface over the Internet or via a corporate intranet.
Following a number of acquisitions beginning in 2003, especially in the area of applications, Oracle Corporation currently maintains a number of product lines:
Oracle Fusion Applications
- Oracle Social Engagement and Monitoring (SEM) System – Oracle has developed a Social Engagement and Monitoring Cloud service that allows businesses to capture relevant brand conversation from global web and social channels to understand what is being said about their product. The Social Engagement and Monitoring cloud provides the most effective and efficient responses across social and customer experience channels. SEM is able to route correct responses to the right team, member, or customer experience channel to ensure the best customer service. The analysis helps to understand what is important to a business’s customers. It identifies trends, spikes, and anomalies to make real time course corrections. It also can identify brand advocates. The SEM cloud identifies customer intention and interests by analyzing the common ways customers talk about a product or a service.
Oracle E-Business Suite
- PeopleSoft Enterprise
- Siebel
- JD Edwards World
Third-party applications
Oracle Corporation works with “Oracle Certified Partners” to enhance its overall product-range. The variety of applications from third-party vendors includes database applications for archiving, splitting and control, ERP and CRM systems, as well as more niche and focused products providing a range of commercial functions in the areas of human resources, financial control and governance,risk management and compliance(GRC). Vendors include Hewlett-packard, UC4 Software and Knoa Software.
ENTERPRISE MANAGEMENT
Oracle Enterprise Manager (OEM) provides web-based monitoring and management tools for Oracle products (and for some third-party software), including database management, middle-ware management, application management, hardware and virtualization management and cloud management.
The Primavera products of Oracle’s Primavera Global Business Unit (PGBU) consist of project management software.
DEVELOPMENT SOFTWARE
Oracle Corporation’s tools for developing applications include (amongest others):
- Oracle Designer
- Oracle Developer – which consists of Oracle Forms,Oracle Discoverer and Oracle Reports
- Oracle JDeveloper
- NetBeans
- Oracle Application Express – also known as APEX
- Oracle SQL Developer
- Oracle SQL*Plus Worksheet
- OEPE, Oracle Enterprise Pack for Eclipse.
Many external and third-party tools make the Oracle database administrator’s tasks easier.
OPERATING SYSTEMS
Oracle develops two operating systems: Oracle Solaris and Oracle Linux.
4. Hardware
Oracle Exadata and Exalogic
- The Sun hardware range acquired by Oracle Corporation’s purchase of Sun Microsystems.
- New Oracle SPARC T-series servers and M-series mainframes developed and released after Sun acquisition
- Engineered systems: pre-engineered and pre-assembled hardware/software bundles for enterprise use
- Exadata Database Machine – hardware/software integrated storage
- Exalogic Elastic Cloud– hardware/software integrated application server
- Exalytic In-Memory Machine– hardware/software integrated in-memory analytics server
- Oracle Database Appliance
- Big Data Appliance– integrated map-reduce/bigdata solution
- SPARC SuperCluster T4-4 – a general purpose engineered system
5. Services
- Oracle Academy (training in computing and commerce in partnership with educational institutions)
- Oracle Cloud Services
- Software as a Service(SaaS)
- Oracle On Demand
- Oracle Applications Cloud – SCM ,EPM,HR,ERP and CX SaaS offerings
- Platform as Service(PaaS)
- Oracle Cloud Platform Services, grouping several Oracle products usable in the cloud: database, Java application server, messaging, big data, process,Node.js etc.
- Infrastructure as a Service(IaaS)
- Compute Service
- Storage Service
- Software as a Service(SaaS)
- Oracle Consulting – technical and business expert services
- Oracle Financing
- Oracle Support
- Product support: Oracle Corporation identifies its customers and their support entitlements using CSI (Customer Support Identifier) codes.Registered customers can submit Service Requests (SRs) – usually via the web-accessible My Oracle Support(MOS).
- Critical Patch Updates: since 2005, Oracle Corporation has grouped collections of patches and security fixes for its products each quarter into a “Critical Patch Update” (CPU), released each January, April, July and October.
- Oracle Configuration Manager (OCM, previously Customer Configuration repository or CCR) gathers and uploads details of the configuration of Oracle software.
- Oracle Auto Service Request (ASR) automatically creates Service Requests for specific hardware faults on qualified Oracle server, storage, Oracle Exadata and Oracle Exalogic products.
- My Oracle Support Community (MOSC)
- Oracle University (training in Oracle products)
- Oracle Certification Program
Why naming convention are important in SQL?
Names Are Long Lived
Data structures are meant to last much longer than application code. Anyone that has worked on a long running system can attest to that.
Well defined data structures and table layouts will outlive any application code. It’s not uncommon to see an application completely rewritten without any changes done to its database schema.
Names Are Contracts
Database objects are referenced by their names, thus object names are part of the contract for an object. In a way you can consider your database table and column names to be the API to your data model.
Once they are set, changing them may break dependent applications. This is all the more reason to name things properly before the first use.
Developer Context Switching
Having consistent naming conventions across your data model means that developers will need to spend less time looking up the names of tables, views, and columns. Writing and debugging SQL is easier when you know that
person_id must be a foreign key to the id field of the person table.Naming Conventions
Avoid quotes: If you have to quote an identifier then you should rename it. Quoted identifiers are a serious pain. Writing SQL by hand using quoted identifiers is frustrating and writing dynamic SQL that involves quoted identifiers is even more frustrating.
This also means that you should never include whitespace in identifier names.
Ex: Avoid using names like
"FirstName" or "All Employees".
Lowercase: Identifiers should be written entirely in lower case. This includes tables, views, column, and everything else too. Mixed case identifier names means that every usage of the identifier will need to be quoted in double quotes (which we already said are not allowed).
Ex: Use
first_name, not "First_Name".
Data types are not names: Database object names, particularly column names, should be a noun describing the field or object. Avoid using words that are just data types such as
text or timestamp. The latter is particularly bad as it provides zero context.
Underscores separate words: Object name that are comprised of multiple words should be separated by underscores (ie. snake case).
Ex: Use
word_count or team_member_id, not wordcount or wordCount.
Full words, not abbreviations: Object names should be full English words. In general avoid abbreviations, especially if they’re just the type that removes vowels. Most SQL databases support at least 30-character names which should be more than enough for a couple English words. PostgreSQL supports up to 63-character for identifiers.
Ex: Use
middle_name, not mid_nm.
Use common abbreviations: For a few long words the abbreviation is both more common than the word itself. “Internationalization” and “localization” are the two that come up most often as
i18n and l10n respectively. In these cases use the abbreviation.
If you’re in doubt, use the full English word. It should be obvious where the abbreviation makes sense.
Avoid reserved words: Avoid using any word that is considered a reserved word in the database that you are using. There aren’t that many of them so it’s not too much effort to pick a different word. Depending on the context, reserved words may require quoting. This means sometimes you’ll write
"user" and sometimes just user.Database vs Excel
SpreadSheets vs Databases
Both spreadsheets and databases play a part in the daily operations of many businesses. While you do not necessarily need to choose between spreadsheets and databases, they are often suited to different types of tasks. Understanding the key differences between spreadsheets and databases is vital if you want to make the best use of either or both of them. Spreadsheets and databases share some characteristics, but they involve different technologies. Databases generally involve a higher level of technical processing.
Technologies :- Spreadsheets and databases generally use different technologies. The most widely used spreadsheet program is Excel, which is part of Microsoft Office. Other spreadsheet programs form part of OpenOffice and GoogleDocs. Database technologies include Microsoft Access, Oracle, MySQL and SQL Server, among many others. Some databases are run on servers and accessed over networks, including the Internet. In most cases, a database will have a software application built on top of it, providing user access to the data. Databases are built and managed by software programmers and Web developers, often using SQL (Structured Query Language). Database applications can be written in many programming languages, including Java, PHP, ASP and others.
Both spreadsheets and databases play a part in the daily operations of many businesses. While you do not necessarily need to choose between spreadsheets and databases, they are often suited to different types of tasks. Understanding the key differences between spreadsheets and databases is vital if you want to make the best use of either or both of them. Spreadsheets and databases share some characteristics, but they involve different technologies. Databases generally involve a higher level of technical processing.
Technologies :- Spreadsheets and databases generally use different technologies. The most widely used spreadsheet program is Excel, which is part of Microsoft Office. Other spreadsheet programs form part of OpenOffice and GoogleDocs. Database technologies include Microsoft Access, Oracle, MySQL and SQL Server, among many others. Some databases are run on servers and accessed over networks, including the Internet. In most cases, a database will have a software application built on top of it, providing user access to the data. Databases are built and managed by software programmers and Web developers, often using SQL (Structured Query Language). Database applications can be written in many programming languages, including Java, PHP, ASP and others.
Processing :- Both spreadsheets and databases offer a range ofprocessing functions. Using these you can manipulate, sort and filter data. Databases offer a greater range of complexity in terms of data manipulation, but this must be expressed in programming or SQL code. However, for basic data processing, spreadsheets provide users with a range of automated functions, which are accessible to people who do not have much technical experience. Some data management needs are only possible using databases, but where this is not the case, a spreadsheet may provide a more usable option.
Accessing and Presenting
Access to a spreadsheet is sometimes limited to one person at a time. With database managementsystems, however, several people can access the same data set. Such systems manage editing of data so that two people cannot alter the same data values at the same time. This preserves dataintegrity, which is harder to manage when using spreadsheets. Output and presentation varies in spreadsheets and databases. With a spreadsheet,you can generate charts and graphs using automated software tools. With a database, such output options are normally a matter for the application providing access to the data. Databases generally require a higher level of technological expertise.Use a database if…*.the information is a large amount that would become unmanageable in spreadsheet form andis related to a particular subject.*.you want to maintain records for ongoing use.*.the information is subject to many changes (change of address, pricing changes, etc.).*.you want to generate reports based on the information.Use a Spreadsheet if…*.you want to crunch numbers and perform automatic calculations.*.you want to track a simple list of data.*.you want to easily create charts and graphs of your data.*.you want to create “What-if” scenarios.
Access to a spreadsheet is sometimes limited to one person at a time. With database managementsystems, however, several people can access the same data set. Such systems manage editing of data so that two people cannot alter the same data values at the same time. This preserves dataintegrity, which is harder to manage when using spreadsheets. Output and presentation varies in spreadsheets and databases. With a spreadsheet,you can generate charts and graphs using automated software tools. With a database, such output options are normally a matter for the application providing access to the data. Databases generally require a higher level of technological expertise.Use a database if…*.the information is a large amount that would become unmanageable in spreadsheet form andis related to a particular subject.*.you want to maintain records for ongoing use.*.the information is subject to many changes (change of address, pricing changes, etc.).*.you want to generate reports based on the information.Use a Spreadsheet if…*.you want to crunch numbers and perform automatic calculations.*.you want to track a simple list of data.*.you want to easily create charts and graphs of your data.*.you want to create “What-if” scenarios.
DBMS and RDBMS
1)
DBMS applications store data as file .
RDBMS applications store data in a tabular form.
DBMS applications store data as file .
RDBMS applications store data in a tabular form.
2)
In DBMS, data is generally stored in either a hierarchical form or a navigational form.
In RDBMS, the tables have an identifier called primary key and the data values are stored in the form of tables.
In DBMS, data is generally stored in either a hierarchical form or a navigational form.
In RDBMS, the tables have an identifier called primary key and the data values are stored in the form of tables.
3)
Normalization is not present in DBMS.
Normalization is present in RDBMS.
Normalization is not present in DBMS.
Normalization is present in RDBMS.
4)
DBMS does not apply any security with regards to data manipulation.
RDBMS defines the integrity constraint for the purpose of ACID (Atomocity, Consistency, Isolation and Durability) property.
DBMS does not apply any security with regards to data manipulation.
RDBMS defines the integrity constraint for the purpose of ACID (Atomocity, Consistency, Isolation and Durability) property.
5)
DBMS uses file system to store data, so there will be no relation between the tables .
in RDBMS, data values are stored in the form of tables, so a relationship between these data values will be stored in the form of a table as well.
DBMS uses file system to store data, so there will be no relation between the tables .
in RDBMS, data values are stored in the form of tables, so a relationship between these data values will be stored in the form of a table as well.
6)
DBMS has to provide some uniform methods to access the stored information.
RDBMS system supports a tabular structure of the data and a relationship between them to access the stored information.
DBMS has to provide some uniform methods to access the stored information.
RDBMS system supports a tabular structure of the data and a relationship between them to access the stored information.
7)
DBMS does not support distributed database .
RDBMS supports distributed database .
DBMS does not support distributed database .
RDBMS supports distributed database .
8)
DBMS is meant to be for small organization and deal with small data. it supports single user .
RDBMS is designed to handle large amount of data. it supports multiple users.
DBMS is meant to be for small organization and deal with small data. it supports single user .
RDBMS is designed to handle large amount of data. it supports multiple users.
9)
Examples of DBMS are file systems, xml etc.
Example of RDBMS are mysql , postgre,
sql server , oracle etc.
After observing the differences between DBMS and RDBMS, you can say that RDBMS is an extension of DBMS. There are many software products in the market today who are compatible for both DBMS and RDBMS. Means today a RDBMS application is DBMS application and vice-versa.
Examples of DBMS are file systems, xml etc.
Example of RDBMS are mysql , postgre,
sql server , oracle etc.
After observing the differences between DBMS and RDBMS, you can say that RDBMS is an extension of DBMS. There are many software products in the market today who are compatible for both DBMS and RDBMS. Means today a RDBMS application is DBMS application and vice-versa.
database and various databases
Database: A database is an organized collection of data. It is the collection of schemes, tables, queries, reports, views and other objects. The data is typically organized to model aspects of reality in a way that supports processes requiring information, such as modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies. In other words, A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images. ![[ File # csp10909445, License # 3089529 ]
Licensed through http://www.canstockphoto.com in accordance with the End User License Agreement (http://www.canstockphoto.com/legal.php)
(c) Can Stock Photo Inc. / z_amir](https://varinderbarmi.files.wordpress.com/2015/08/database-wordcloud.jpg?w=660&h=396)
![[ File # csp10909445, License # 3089529 ]
Licensed through http://www.canstockphoto.com in accordance with the End User License Agreement (http://www.canstockphoto.com/legal.php)
(c) Can Stock Photo Inc. / z_amir](https://varinderbarmi.files.wordpress.com/2015/08/database-wordcloud.jpg?w=660&h=396)
Database management system(DBMS): A database management system(DBMS) is a compute
r software application that interacts with the user, other applications, and the database itself to capture and analyze data. A general-purpose DBMS is designed to allow the definition, creation, querying, update, and administration of databases. Choosing the right database system makes a difference. Some work on specific operating systems, while others don’t. Lets dig into some of them.
Oracle
r software application that interacts with the user, other applications, and the database itself to capture and analyze data. A general-purpose DBMS is designed to allow the definition, creation, querying, update, and administration of databases. Choosing the right database system makes a difference. Some work on specific operating systems, while others don’t. Lets dig into some of them.Redis (V3.0RC)
- Written in: C

- Main point:Blazing fast
- License: BSD
- Protocol: Telnet-like, binary safe
- Disk-backed in-memory database,
- Dataset size limited to computer RAM (but can span multiple machines’ RAM with clustering)
- Master-slave replication, automatic failover
- Simple values or data structures by keys
- but complex operations like ZREVRANGEBYSCORE.
- INCR & co (good for rate limiting or statistics)
- Bit operations (for example to implement bloom filters)
- Has sets (also union/diff/inter)
- Has lists (also a queue; blocking pop)
- Has hashes (objects of multiple fields)
- Sorted sets (high score table, good for range queries)
Cassandra (2.0)
- Written in: Java

- Main point: Store hugedatasets in “almost” SQL
- License: Apache
- Protocol: CQL3 & Thrift
- CQL3 is very similar SQL, but with some limitations that come from the scalability (most notably: no JOINs, no aggregate functions.)
- CQL3 is now the official interface. Don’t look at Thrift, unless you’re working on a legacy app. This way, you can live without understanding ColumnFamilies, SuperColumns, etc.
- Querying by key, or key range (secondary indices are also available)
- Tunable trade-offs for distribution and replication (N, R, W)
- Data can have expiration (set on INSERT).
- Writes can be much faster than reads (when reads are disk-bound)
- Map/reduce possible with Apache Hadoop
HBase (V0.92.0)
- Written in: Java
- Main point: Billions of rows X millions of columns
- License: Apache
- Protocol: HTTP/REST (also Thrift)

- Modeled after Google’s BigTable
- Uses Hadoop’s HDFS as storage
- Map/reduce with Hadoop
- Query predicate push down via server side scan and get filters
mySQL
- Written in: C and C++

- License: OpenSource
- Protocol: HTTP
- Free to use
- Great Performance
- Very user-friendly
- Incredible security
- Scalable
- Works with many operating systems
- Supports many development interfaces
Oracle
- Written in: C and C++
- License: PULA
- Protocol: HTTP
- Very feature rich
- Highly reliable
- Flashback technology
- Capable of running large ILTB and VLDBs
Other various databases
MongoDB (2.6.7)
- Written in: C++
- Main point: Retains some friendly properties of SQL. (Query, index)
- License: AGPL (Drivers: Apache)
- Protocol: Custom, binary (BSON)
- Master/slave replication (auto failover with replica sets)
- Sharding built-in
- Queries are javascript expressions
- Better update-in-place than CouchDB
- Uses memory mapped files for data storage
- Performance over features
- Journaling (with –journal) is best turned on
- On 32bit systems, limited to ~2.5Gb
CouchDB (V1.2)
- Written in: Erlang
- Main point: DB consistency, ease of use
- License: Apache
- Protocol: HTTP/REST
- Bi-directional (!) replication,
- continuous or ad-hoc,
- with conflict detection,
- thus, master-master replication. (!)
- MVCC – write operations do not block reads
- Crash-only (reliable) design
- Needs compacting from time to time
- Views: embedded map/reduce
- Formatting views: lists & shows
- Server-side document validation possible
- Authentication possible
- Real-time updates via ‘_changes’ (!)
OrientDB (2.0)
- Written in: Java
- Main point: Document-based graph database
- License: Apache 2.0
- Protocol: binary, HTTP REST/JSON, or Java API for embedding
- Has transactions, full ACID conformity
- Can be used both as a document and as a graph database (vertices with properties)
- Both nodes and relationships can have metadata
- Multi-master architecture
- Supports relationships between documents via persistent pointers (LINK, LINKSET, LINKMAP, LINKLIST field types)
- SQL-like query language (Note: no JOIN, but there are pointers)
Kyoto Tycoon (0.9.56)
- Written in: C++
- Main point: A lightweight network DBM
- License: GPL
- Protocol: HTTP (TSV-RPC or REST)
- Based on Kyoto Cabinet, Tokyo Cabinet’s successor
- Multitudes of storage backends: Hash, Tree, Dir, etc (everything from Kyoto Cabinet)
- Kyoto Cabinet can do 1M+ insert/select operations per sec (but Tycoon does less because of overhead)
- Lua on the server side
- Language bindings for C, Java, Python, Ruby, Perl, Lua, etc
Most Popular Database
Out of all above MySQL and Oracle are most popular. When looking at the popularity of MySQL vs. Oracle, it’s important to note what each is used for most. Oracle is sued more for larger enterprises, while MySQL is used for smaller projects. Out of the two, MySQL is the most popular. Since it’s used with WordPress, which is the most popular content management system for blogging and building websites, its use more often than Oracle. However, for larger enterprises, Oracle is by far the more popular choice. Even though MySQL is used with larger sites, such as Facebook and YouTube, it’s not as popular with larger enterprises as Oracle. If you have a choice between MySQL vs. Oracle, you will need to look at the specific project to make this decision.
- Protocol: Telnet-like, binary safe
- Disk-backed in-memory database,
- Dataset size limited to computer RAM (but can span multiple machines’ RAM with clustering)
- Master-slave replication, automatic failover
- Simple values or data structures by keys.
Upload image or any file in PHP
We can upload image or any file from our computer to web page. This can be done using <input type=’file’> tag in <form>. For uploading any file ,we have to follow some rules related to <form> for security reasons:, these rules are:
- Make sure that the form uses method=”post”.
- The form also needs the following attribute: enctype=”multipart/form-data”. It specifies which content-type to use when submitting the form.
We have to make folder for storing uploaded files at specified location from where server can get it. in localhost, we can make folder in htdocs(in case of xamp) or in www(in case of wamp).
# program to upload file:
# output:
After uploading file:
cookies and session
COOKIES:
A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user’s computer. Each time the same computer requests a page with a browser, it will send the cookie too. With PHP, you can both create and retrieve cookie values.
# create cookies with PHP
A cookie is created with the setcookie() function.
# syntax:
setcookie(name, value, expire, path, domain, secure, httponly); OR
setcookie(‘user/name’,’value’,time());
Only the name parameter is required. All other parameters are optional.
So what are the most popular uses of cookies? They are:
- To store username/password information so that the user doesn’t have to log in every time they visit the website (“remember me” sign ins).
- To simply remember the user’s name.
- To keep track of a user’s progress during a specified process.
- To remember a user’s theme.
# program to set the cookie:
Run this program into your browser. then yopur cookie will get set.
# program to get value from currently running cookie.
# output:
//Show value of cookie specified by name.
We can also see currently running cookies in browser.To show all cookies in chrome, follow these steps:
Google chrome -> settings -> under privacy click on content settings.. tab, then new window will appear as follow:
Under cookies, click on “all cookies and site data” button. then it will show all currently running cookies, as follows:
# unset or destroy the cookie:
we can remove or destroy cookie using following function.
setcookie(‘user’,”,time() – 3600);
e.g.
<?php
cookie(‘jaspreet’,”, time() – 3600);
?>
cookie(‘jaspreet’,”, time() – 3600);
?>
# advantages of cookie:
1. Cookies do not require any server resources since they are stored on the client.
2. Cookies are easy to implement.
2. Cookies are easy to implement.
# disadvantages of cookie:
1)Cookies can be disabled on user browsers
2)Cookies are transmitted for each HTTP request/response causing overhead on bandwidth
3)No security for sensitive data
2)Cookies are transmitted for each HTTP request/response causing overhead on bandwidth
3)No security for sensitive data
# cookie limitations:
1)Most browsers support cookies of up to 4096 bytes(4 kbytes)
2)Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded.
3)Browser supports 300 cookies towards different websites.
4)Complex type of data not allowed(eg: dataset), allows only plain text (ie, cookie allows only string content)
5)Cookies are browser specific (ie, one browser type[IE] stored cookies will not be used by another browser type[firefox]).
2)Most browsers allow only 20 cookies per site; if you try to store more, the oldest cookies are discarded.
3)Browser supports 300 cookies towards different websites.
4)Complex type of data not allowed(eg: dataset), allows only plain text (ie, cookie allows only string content)
5)Cookies are browser specific (ie, one browser type[IE] stored cookies will not be used by another browser type[firefox]).
Sessions:
A session is a way to store information (in variables) to be used across multiple pages. Unlike a cookie, the information is not stored on the users computer. When you work with an application, you open it, do some changes, and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end. But on the internet there is one problem: the web server does not know who you are or what you do, because the HTTP address doesn’t maintain state. Session variables solve this problem by storing user information to be used across multiple pages (e.g. username, favorite color, etc). By default, session variables last until the user closes the browser. So, Session variables hold information about one single user, and are available to all pages in one application. Most sessions set a user-key on the user’s computer that looks something like this: 765487cf34ert8dede5a562e4f3a7e12. Then, when a session is opened on another page, it scans the computer for a user-key. If there is a match, it accesses that session, if not, it starts a new session.
# start a session:
A session is started with the session_start() function. Session variables are set with the PHP global variable: $_SESSION.
# program to start a session:
# output:
]Note: The session_start() function must be the very first thing in your document. Before any HTML tags. Also notice that all session variable values are stored in the global $_SESSION variable.
# get session variable value:
# program to get session variable value:
# destroy session variable:
session_unset() and session_destroy() is used to destroy session. session_unset() is used to remove session variable and session_destroy() is used to destroy session entirely.
e.g.
<?php
session_start();
session_destroy();
echo “session has been destroyed”;
?>
session_start();
session_destroy();
echo “session has been destroyed”;
?>
# output:
session has been destroyed












No comments:
Post a Comment