You are on page 1of 22

Welcome to …

Technology Education & Research


Integrated Institution
Presentation on PHP

Submitted to:-
Mrs. Neha Gulati
HOD of CSE Department

Submitted By:-
Sujata Maurya
Computer Science & Engineering
What is PHP?
• PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-
used open source general-purpose scripting language that is especially
suited for web development and can be embedded into HTML.
 An introductory example
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
• PHP is a server side scripting language.
• Scripting language is that language which is
used to connect different application to each
other.
• PHP works in between the browser and the
server.
• Using PHP we perform
computational/server/database programming.
• It supports Object oriented programming
features.
HISTORY OF PHP
It is an open source technology and runs on most operating systems and with
most Web servers. PHP was written in the C programming language by
Rasmus Lerdorf in 1994 for use in monitoring his online resume and related
personal information. For this reason, PHP originally stood for "Personal
Home Page“
PHP/FI version 1.0 was never really used outside of Rasmus own web site.
With the introduction of PHP/FI 2.0 this began to change. When PHP 3 was
released in 1997, adoption of PHP exploded beyond all belief.

Officially called "Personal Home Page Tools


1.0 8 June 1995 (PHP Tools)". This is the first use of the name
"PHP".
Latest Version

7.3 6 December 2018


PHP SOFTWARE
ADVANTAGES OF PHP
• Open source
• There are good tools available
• Codes and solutions are easily available
• Fast installation and setup for development
• Widely Available
• Speed of Development
• Using PHP we perform logical and
mathematical task in the we page.
WHAT IS XAMPP?
XAMPP stands for Cross-Platform (X), Apache (A), MariaDB (M), PHP (P) and Perl
(P). Since XAMPP is simple, lightweight Apache distribution it is extremely easy for
developers to create a local web server for testing and deployment purposes.
Everything you needed is to set up a web server – server application (Apache),
database (MariaDB), and scripting language (PHP). XAMPP works equally well on
Linux, Mac, and Windows.
HOW TO WORK WITH PHP?
• STEP1:-Use the text editor “NOTEPAD”.
STEP:-2 CREATE THE DATABSE
STEP:-3 DATABSE CONNECTIVITY
<?php
$link=mysqli_connect("localhost","root","", "form");
if($link)
{
if(isset($_POST['btn']))
{
$name=$_POST['firstname'];
$lastname=$_POST['lastname'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$password=$_POST['psw'];
$cpwd=$_POST['psw-repeat'];

if($password!=$cpwd)
echo"<script>alert('Password mismatch')</script>";
else
{
//echo"<script>alert('Password match')</script>";
$qryl=mysqli_query($link,"select count(u_email)from registration_table
where u_email='$email'");
$rec=mysqli_fetch_array($qryl);
//echo $rec[0];

if($rec[0]==0)
$qry=mysqli_query($link,"insert into
registration_table(u_name,u_lastname,u_gender,u_email,u_password)values('$name','$lastna
me','$gender',
'$email','$password')");

else
echo "email alreaddy exist";
}
}
}
else
{
echo"connection error";
}

?>
STEP:-4 EXECUTE USING XAMPP
SERVER AND STORE DATA INTO
DATABASE
SNAPSHOTS OF PROJECTS
Contact.php
CODE FOR UPLOAD PIC
<?php
$link=mysqli_connect("localhost","root","", "form")or die("Connection error");
if (isset($_POST['btn']))
{
$error=$_FILES['file1']['error'];
$type=$_FILES['file1']['type'];

//echo $type;

if($error==4) //check file not selected.....


echo "plz select any File...";
else
{
$filename=$_FILES['file1']['name'];
$tmpname=$_FILES['file1']['tmp_name'];

move_uploaded_file($tmpname,"img/".$filename);

if(file_exists("img/".$filename)) //checl file already existt...


echo "This File Already exist..";
else
{
$qry=mysqli_query($link,"insert into upload_pic (pic_name) values('$filename')");

if($qry)
echo "File Uploaded...";
else
echo "File Not Uploaded...";
}
}

// fetch img............
$getimg=mysqli_query($link,"select * from upload_pic");
while($rec=mysqli_fetch_array($getimg))
{
echo "<img src='img/$rec[1]';>";
}
}
?>
Conclusion
• PHP overcomes the problem of the HTML
which is only used to design and structure the
Web pages.
• Using the PHP we can Store the information on
the server and also access the information
from the server.
• Using the PHP we can store the data into the
database and also access the data from the
databse.
THANK YOU!!...

You might also like