Web Server

-Web

server: IIS, Apache
-Script Language: ASP, PHP..
-Database: mysql, mssql…
Operation Principles
What is PHP?

-PHP

stands for PHP: Hypertext Preprocessor.
-PHP is a server-side scripting language, like ASP
-PHP script...
What is a PHP File?

-PHP files can contain text, HTML tags and scripts.
-PHP files are returned to the browser as plain H...
What is MySQL?
-MySQL is a database server.
-MySQL is ideal for both small and large applications.
-MySQL supports standar...
LAMP

-L:

Linux(Fedora, CentOS, Debian, Ubuntu).
-A: Apache.
-M: Mysql.
-P: PHP.
PHP Syntax
-<?php

echo "Hello World";
?>
-//This is a comment
- /*
This is
a comment
block
*/
PHP Variables

-$var_name

= value;

-<?php

$txt="Hello World!";
$x=16;
?>
- a-z, A-Z, 0-9, and _
PHP String Variables
-<?php

$txt="Hello World";
echo $txt;// Hello World
?>
-<?php
$txt1="Hello World!";
$txt2="What a ni...
PHP Operators
-Arithmetic Operators
-Assignment Operators
-Comparison Operators
-Logical Operators
PHP Operators
(Arithmetic)
PHP Operators
(Assignment )
PHP Operators
(Comparison)
PHP Operators
(Logical)
PHP If...Else Statements
-if

(condition)
code to be executed if condition is true;
else
code to be executed if condition ...
PHP Switch Statement
-switch

(n)

{
case label1:
code to be executed if n=label1;
break;
case label2:
code to be executed...
PHP Switch Statement(Cont)
<?php
switch ($x)
{
case 1:
echo "Number 1";
break;
case 2:
echo "Number 2";
break;
case 3:
ech...
PHP Arrays
Numeric array - An array with a numeric index.
* $cars=array("Saab","Volvo","BMW","Toyota");

Associative array...
PHP Looping - While Loops
while (condition)
{
code to be executed;
}
<?php
$i=1;
while($i<=5)
{
echo "The number is " . $i...
PHP Looping - For Loops
foreach ($array as $value)
{
code to be executed;
}
for (init; condition; increment)
{
code to be ...
PHP Functions
function functionName()
{
code to be executed;
}

<?php
function writeName()
{
echo "Kai Jim Refsnes";
}

ec...
PHP Forms and User Input
<html>
<body>

<html>
<body>

<form
action="welcome.php"
method="post">
Name: <input type="text"
...
PHP $_GET Function
<html>
<body>

<html>
<body>

<form
action="welcome.php"
method=“get">
Name: <input type="text"
name="f...
PHP $_POST Function
<html>
<body>

<html>
<body>

<form
action="welcome.php"
method=“post">
Name: <input type="text"
name=...
The PHP $_REQUEST Function

-The

$_REQUEST function can be used to collect form data sent with both
the GET and POST meth...
PHP With Database

mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error()...
Contact Us
www.PhpTrainingIndore.in
Voyage Infosystems (p) Ltd.
4/B , Shraddha Shree Ext.
MR-09,Indore 452001, MP , India
Upcoming SlideShare
Loading in...5
×

PHP Training Indore Best Institute

9,460

Published on

PHP Training. PHP Training in indore. PHP is a powerful tool for making dynamic and interactive Web pages.

Published in: Education, Technology
1 Comment
0 Likes
Statistics
Notes
  • your institute is really a great team player in I.T sector which nourish the upcoming fresher and make them quality based developer
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
9,460
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
14
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

PHP Training Indore Best Institute

  1. 1. Web Server -Web server: IIS, Apache -Script Language: ASP, PHP.. -Database: mysql, mssql…
  2. 2. Operation Principles
  3. 3. What is PHP? -PHP stands for PHP: Hypertext Preprocessor. -PHP is a server-side scripting language, like ASP -PHP scripts are executed on the server -PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.) -PHP is an open source software -PHP is free to download and use
  4. 4. What is a PHP File? -PHP files can contain text, HTML tags and scripts. -PHP files are returned to the browser as plain HTML. -PHP files have a file extension of ".php", ".php3", or ".phtml“.
  5. 5. What is MySQL? -MySQL is a database server. -MySQL is ideal for both small and large applications. -MySQL supports standard SQL. -MySQL compiles on a number of platforms. -MySQL is free to download and use.
  6. 6. LAMP -L: Linux(Fedora, CentOS, Debian, Ubuntu). -A: Apache. -M: Mysql. -P: PHP.
  7. 7. PHP Syntax -<?php echo "Hello World"; ?> -//This is a comment - /* This is a comment block */
  8. 8. PHP Variables -$var_name = value; -<?php $txt="Hello World!"; $x=16; ?> - a-z, A-Z, 0-9, and _
  9. 9. PHP String Variables -<?php $txt="Hello World"; echo $txt;// Hello World ?> -<?php $txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; ?> - <?php echo strlen("Hello world!"); // 12 ?> -<?php echo strpos("Hello world!","world"); //6 ?>
  10. 10. PHP Operators -Arithmetic Operators -Assignment Operators -Comparison Operators -Logical Operators
  11. 11. PHP Operators (Arithmetic)
  12. 12. PHP Operators (Assignment )
  13. 13. PHP Operators (Comparison)
  14. 14. PHP Operators (Logical)
  15. 15. PHP If...Else Statements -if (condition) code to be executed if condition is true; else code to be executed if condition is false; -<?php $d=date("D"); if ($d=="Fri") echo "Have a nice weekend!"; else echo "Have a nice day!"; ?>
  16. 16. PHP Switch Statement -switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; default: code to be executed if n is different from both label1 and label2; }
  17. 17. PHP Switch Statement(Cont) <?php switch ($x) { case 1: echo "Number 1"; break; case 2: echo "Number 2"; break; case 3: echo "Number 3"; break; default: echo "No number between 1 and 3"; } ?>
  18. 18. PHP Arrays Numeric array - An array with a numeric index. * $cars=array("Saab","Volvo","BMW","Toyota"); Associative array - An array where each ID key is associated with a value * $ages = array("Peter"=>32, "Quagmire"=>30, "Joe"=>34); Multidimensional array - An array containing one or more arrays. * $families = array ("Griffin"=>array ("Peter","Lois","Megan"), "Quagmire"=>array("Glenn") );
  19. 19. PHP Looping - While Loops while (condition) { code to be executed; } <?php $i=1; while($i<=5) { echo "The number is " . $i . "<br />"; $i++; } ?> do { code to be executed; } while (condition); <?php $i=1; do { $i++; echo "The number is " . $i . "<br />"; } while ($i<=5); ?>
  20. 20. PHP Looping - For Loops foreach ($array as $value) { code to be executed; } for (init; condition; increment) { code to be executed; } <?php for ($i=1; $i<=5; $i++) { echo "The number is " . $i . "<br />"; } ?> <?php $x=array("one","two","three" ); foreach ($x as $value) { echo $value . "<br />"; } ?>
  21. 21. PHP Functions function functionName() { code to be executed; } <?php function writeName() { echo "Kai Jim Refsnes"; } echo "My name is "; writeName(); ?> <html> <body> <?php function &add($x,$y) { $total=$x+$y; return $total; } echo "1 + 16 = " . add(1,16); ?> </body> </html>
  22. 22. PHP Forms and User Input <html> <body> <html> <body> <form action="welcome.php" method="post"> Name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> Welcome <?php echo $_POST["fname"]; ?>!<br /> You are <?php echo $_POST["age"]; ?> years old. </body> </html> </body> </html>
  23. 23. PHP $_GET Function <html> <body> <html> <body> <form action="welcome.php" method=“get"> Name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> Welcome <?php echo $_GET["fname"]; ?>!<br /> You are <?php echo $_GET["age"]; ?> years old. </body> </html> http://www.dqn.vn/welcome. php?fname=Peter&age=37 </body> </html>
  24. 24. PHP $_POST Function <html> <body> <html> <body> <form action="welcome.php" method=“post"> Name: <input type="text" name="fname" /> Age: <input type="text" name="age" /> <input type="submit" /> </form> Welcome <?php echo $_POST["fname"]; ?>!<br /> You are <?php echo $_POST["age"]; ?> years old. </body> </html> http://www.dqn.vn/welcome. php. </body> </html>
  25. 25. The PHP $_REQUEST Function -The $_REQUEST function can be used to collect form data sent with both the GET and POST methods. -Welcome <?php echo $_REQUEST["fname"]; ?>!<br /> You are <?php echo $_REQUEST["age"]; ?> years old.
  26. 26. PHP With Database mysql_connect("localhost", "mysql_user", "mysql_password") or die("Could not connect: " . mysql_error()); mysql_select_db("mydb"); $result = mysql_query("SELECT id, name FROM mytable"); while ($row = mysql_fetch_array($result)) { printf("ID: %s Name: %s", $row[0], $row[1]); } mysql_free_result($result); mysql_close();
  27. 27. Contact Us www.PhpTrainingIndore.in Voyage Infosystems (p) Ltd. 4/B , Shraddha Shree Ext. MR-09,Indore 452001, MP , India
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×