Search This Blog

07 January 2018

PHP Intro for Begineers



                    PHP ---> HYPERTEXT PREPROCESSOR



What is php?
PHP is server side scripting  Language ,it is used to develop dynamic webpages
Php script  run on the server side.

PHP Advantage:
  Ø PHP is used to webprogramming and WebDevelopment.
  Ø Backend tool used for MYSQL
  Ø PHP run  all Platforms  Windows ,Linux,Unix,Mac
  Ø Dynamic webpages
  Ø PHP is used to Large Number of  RDBMS
  Ø PHP is Opensource
  Ø PHP is Object Oriented Language
  Ø PHP is Fast,Reliable and then Secure
  Ø PHP support Powerfull library support
  Ø Many Framework  Available
  Ø PHP support many Protocols like as  LDAP,POP3,IMAP

 
PHP Installation:

Requirements of  PHP:

XAMPP=>Cross platform Apache Mysql Php Perl  (WINDOWS + LINUX)
LAMP=>Linux Apache Mysql  Php
WAMP=>Windows Apache Mysql Php
Download these  Requirements for  your  Platform and then Install Your application
Next Run Your Browser  Type Url : localhost ->Enter
Mysql Database: type url --> http://localhost/phpmyadmin


Syntax:
<?php
echo “My First php Program ”;
?>
This file are saved here
Xampp ----c:/xampp/htdocs/yourpgm (or) c:/xampp/htdocs/YourFolder/first.php
WAMP----- c:/wamp/www/yourpgm (or) c:/wamp/www/YourFolder/first.php
LAMP------/var/www/html/Your file  (or)   /var/www/html/YourDirectory/ first.php

How To Run:

Open  Your Browser  and type url

See Output:

  

Sample Program :

<?php 
$a=10;
$b=20;
$i=0;
echo $a+$b;
echo $a-$b;
echo $a*$b;
echo $a/$b;
for($i=0;$i<=100;$i++){
echo " Number is ".$i;
}
while($i<10){
echo " number is ".$i;
}
if($a > $b){
echo "a is biggest number";
} else {
echo " b is biggest number";
}
$op="";
$a > $b ? $op=" a is big " : $op=" b is big " ;

?>

how to one page value to another page:

use  Session varaible 

session variables is used to pass value one page to another page 

<?php 

// session start for this section

session_start(); 

syntax :

$_SESSION[' session name ']="Sample value";

how to get another page value

start the session 

echo $_SESSION[' session  name'];








No comments:

Post a Comment

Jquery or Javascript Start Exam Time

 <script> function startTimer() {      var date = "<?php echo $date ?>"; // dynamic date      var time = "<?...