Concept of Web Programming An Overview of PHP Vol 1
Concept of Web Programming An Overview of PHP Vol 1
ISSN 2229-5518
Abstract: computer science and its application have come this far and it is standing on a solid
ground. But its strength is fully determined by the nature of controls being set in motion by its
users. Most often, people tend to say one programming language is better compared to another.
Yes; that is not disputed, but the beauty of a programming language is totally defined by the
programmer who uses such language. This paper tries to bring out the concept of programming;
covering php (hypertext preprocessor) in regards to web development. In this volume (1), the
basic concept of this language is looked into so that those who tend to run off its usage should
have reasons to say, indeed; programming is not about the software you use, but your skill and
understanding of the subject matter.
IJSER
Keywords: Programming, Program, Structure, Science, php, computer programming, computer
science, overview, database, server, host, web servers, server side scripting language
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 12, December-2019 2
ISSN 2229-5518
modules. Such is the case with Yahoo that highlight the advantages of adopting PHP at
uses PHP to "glue" together code written in the Enterprise level and how programmers
different languages1. and IT managers can benefit. Finally, we
The purpose of this paper is to summarize will give an outlook on the future
the history of PHP and offer an overview of development of PHP.
its current status and market. We will then
IJSER
version of PHP way back in 1994.
development a possibility for the first
b. PHP is a recursive acronym for "PHP:
time.
Hypertext Preprocessor".
g. PHP is forgiving: PHP language tries to
c. PHP is a server side scripting language
be as forgiving as possible.
that is embedded in HTML. It is used to
h. PHP Syntax is C-Like.
manage dynamic content, databases,
PHP’s penetration and market shares differ
session tracking, even build entire e-
from region to region. Since the basic
commerce sites.
combination of Linux, Apache, MySQL and
d. It is integrated with a number of popular
PHP (without additional commercial tools)
databases, including MySQL,
provides an almost enterprise grade
PostgreSQL, Oracle, Sybase, Informix,
application platform without any licensing
and Microsoft SQL Server.
costs, PHP's market share is very high in
e. PHP is pleasingly zippy in its execution,
developing countries. The Ukraine and Sao
especially when compiled as an Apache
Tomé for example lead the list of countries
module on the Unix side. The MySQL
with the highest market share for PHP with
server, once started, executes even very
69.7 and 68.2 percent
complex queries with huge result sets in
Respectively2. In the leading industrial
record-setting time.
nations, USA, Germany and Japan hold
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 12, December-2019 3
ISSN 2229-5518
IJSER
1.2.2 Common Uses of PHP Six important characteristics make PHP's
PHP performs system functions, i.e. from practical nature possible:
files on a system it can create, open, read, Simplicity
write, and close them. The other uses of Efficiency
PHP are: Security
a. PHP can handle forms, i.e. gather data Flexibility
from files, save data to a file, thru email Familiarity
you can send data, return data to the Server Side
user. 1.2.4 PHP Tags
b. You add, delete, and modify elements Just like every other programming or
within your database thru PHP. scripting languages, php is a language that
c. Access cookies variables and set can stand on its own or be incorporated into
cookies. html code. But for it to work, it has to be
d. Using PHP, you can restrict users to within the right tag as shown below;
access some pages of your website. <?php //PHP code goes here ?>
e. It can encrypt data. <? //PHP code goes here ?>
<script language="php"> PHP code goes
1.2.3 Characteristics of PHP here </script>
1.2.5 What to know
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 12, December-2019 4
ISSN 2229-5518
To execute a given code, you must fix your It runs either on local server or live server
code in between the right tags PHP name style is like every other naming
PHP is a server side scripting language style but you must add a dollar ($) to the
Every php file name must have a .php beginning of the name and you must not
extension e.g. profile.php start the name with 1. E.g. $1ID (wrong).
You need a server to run php code $ID (Right).
It can be converted into a stand-alone
application
1.3. Preparing to work with PHP for web MySQL are then linked together with some
Application common denominator, where the values of
PHP needs a database to work so we use it the common field are the same.
IJSER
primary with DBMS like MySql and others. For an example of this structure, imagine a
Because MySQL is a relational database table that includes a customer’s name,
management system, it allows you to address, and ID number, and another table
separate information into tables or “areas of that includes the customer’s ID number and
pertinent information.” In non-relational past orders he has placed. The common field
database systems, all the information is is the customer’s ID number, and the
stored in one big area, which makes it much information stored in the two separate tables
more difficult and cumbersome to sort and would be linked together via fields where
extract only the data you want. In MySQL, this number is equal. This enables you to see
each table consists of separate fields, which all the information related to this customer
represent each bit of information. at one time4.
For example, one field could contain a The following need to configure as shown
customer’s first name, and another field below;
could contain his last name. Fields can hold Server: Make a choice of server to be used.
different types of data, such as text, E.g. Apache, WAMP, XAMP, IIS etc.
numbers, dates, and so on. Installation: Install the server and configure
You create database tables based on what it accordingly
type of information you want to store in
them. The separate “areas” or tables of
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 12, December-2019 5
ISSN 2229-5518
Page Setup: Proceed into the root folder, Connectivity: Use your basic text editor to
which like to c:\ AppServ\www\ and create initiate the connection from your work
you work folder therein. environment to the server
1 <?PHP
2 //Defining connectivity criteria
3 $hostname = “localhost”;
4 $user = “your defined name but by default it is root”;
5 $paswrd = “your defined password”;
6 $dbname = “your database name”;
7 // Making the connection to the server
8 $servcon = MySqli_connect($hostname,$user,$paswrd,$dbname);
9 //Check for successful connection
IJSER
10 IF(!$servcon)
11 {
13 Echo “<script>alert(‘sorry there was no connection, try again’);</script>”;
14 }
15 ?>
If you study the code carefully, you will see formation open formation. For example;
from line 3, 4, 5 and 6 that your criteria for $sconect = mysql_connect(“localhost”,”root”,”pswrd”);
From the code above, we have gone back to mysql
connection were defined based on whatever
native connectivity module and it is easy to use. If
your database name is and the user that you
you are not ready to right a different module to check
have defined. This information is now if the connection was successful or not, you can make
entered at line 8 to initiate the connection. you of or die(mysql_error()); at the end of line 8
On lie 10, we try to see if the connection to above. The question; how does the function above
work both at the default stage and custom stage will
the server is/was not successful (that is the
be emphasized for clearer understanding in volume
meaning of the exclamation “!” mark
two.
therein), then the system should execute the
instruction on line 13 accordingly. Note the
1.4 Conclusion
structure of the code can be restricted in a
PHP is a programming language that can do
way that connection will only use a single
extremely great in terms web development.
IJSER © 2019
http://www.ijser.org
International Journal of Scientific & Engineering Research Volume 10, Issue 12, December-2019 6
ISSN 2229-5518
It has come to stay and with availability of be converted fully into an installable format
so many frameworks out there, you do just like every other window application like
whole lot with this hand tool and the end office application. More will be on volume
product will be so great. II
PHP can handle application, which ranges
from web-based to standalone and this can
Reference
1. Jesus Castagnetto, harish Rawat, Sascha Schumann, Chris Scollo, Deepak Veliath (1999):
Professional PHP Programming; Wrox Press Ltd, ISBN 1-861002-96-3
2. Source: http://www.nexen.net/chiffres_cles/phpversion/php_statistics_for_june_2006.php#adoption
IJSER
3.Source: http://www.eweek.com/article2/0,1895,1983364,00.asp
4. Michael Glass, Yann Le Scouarnec, Elizabeth naramore, Gary mailer, Jeremy Stolz, Jason
Gerner (1999). Beginning PHP, Apache, MySQL Web Development; Wiley Publishing, Inc.
IJSER © 2019
http://www.ijser.org