Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Saturday 23 March 2019

Learning PHP 7 Paperback – Import, 6 Jan 2016 by Antonio Lopez (Author)

Learn the art of PHP programming through this example-rich book filled to the brim with tutorials every PHP developer needs to know About This Book * Set up the PHP environment and get started with web programming * Leverage the potential of PHP for server-side programming, memory management, and object-oriented programming (OOP) * This book is packed with real-life examples to help you implement the concepts as you learn Who This Book Is For If you are a web developer or programmer who wants to create real-life web applications using PHP 7, or a beginner who wants to get started with PHP 7 programming, this book is for you. Prior knowledge of PHP, PHP 7, or programming is not mandatory. What You Will Learn * 

Set up a server on your machine with PHP * Use PHP syntax with the built-in server to create apps * Apply the OOP paradigm to PHP to write richer code * Use MySQL to manage data in your web applications * Create a web application from scratch using MVC * Add tests to your web application and write testable code * Use an existing PHP framework to build and manage your applications * Build REST APIs for your PHP applications * Test the behavior of web applications with Behat In Detail PHP is a great language for building web applications. It is essentially a server-side scripting language that is also used for general purpose programming.

 PHP 7 is the latest version with a host of new features, and it provides major backwards-compatibility breaks. This book begins with the fundamentals of PHP programming by covering the basic concepts such as variables, functions, class, and objects. You will set up PHP server on your machine and learn to read and write procedural PHP code. After getting an understanding of OOP as a paradigm, you will execute MySQL queries on your database. Moving on, you will find out how to use MVC to create applications from scratch and add tests. 
Then, you will build REST APIs and perform behavioral tests on your applications. By the end of the book, you will have the skills required to read and write files, debug, test, and work with MySQL. Style and approach This book begins with the basics that all PHP developers use every day and then dives deep into detailed concepts and tricks to help you speed through development. You will be able to learn the concepts by performing practical tasks and implementing them in your daily activities, all at your own pace.

Buy :

Learning PHP 7 Paperback – Import, 6 Jan 2016 by Antonio Lopez (Author) 

PDF Download :

Learning PHP 7 Paperback – Import, 6 Jan 2016 by Antonio Lopez (Author) 


Tuesday 12 March 2019

Learning PHP, MySQL & JavaScript, 5th Edition With jQuery, CSS & HTML5 (Learning PHP, MYSQL, Javascript, CSS & HTML5)

Build interactive, data-driven websites with the potent combination of open-source technologies and web standards, even if you have only basic HTML knowledge. With this popular hands-on guide, you'll tackle dynamic web programming with the help of today's core technologies: PHP, MySQL, JavaScript, jQuery, CSS and HTML5.

Explore each technology separately, learn how to use them together and pick up valuable web programming practices along the way. At the end of the book, you'll put everything together to build a fully functional social networking site, using XAMPP or any development stack you choose.

  • Learn PHP in-depth, along with the basics of object-oriented programming
  • Explore MySQL, from database structure to complex queries
  • Use the MySQLi Extension, PHP's improved MySQL interface
  • Create dynamic PHP web pages that tailor themselves to the user
  • Manage cookies and sessions and maintain a high level of security
  • Master the JavaScript language-and enhance it with jQuery
  • Use Ajax calls for background browser/server communication
  • Acquire CSS2 and CSS3 skills for professionally styling your web pages
  • Implement all of the new HTML5 features, including geolocation, audio, video and the canvas
Buy :

Learning PHP, MySQL & JavaScript with j Query, CSS & HTML5 Paperback – 2015 by Robin Nixon  

PDF Download :

Learning PHP, MySQL & JavaScript with j Query, CSS & HTML5 Paperback – 2015 by Robin Nixon 



Tuesday 5 March 2019

Beginning PHP 5 and MySQL 5: From Novice to Professional (Beginning Series: Open Source) by W. Gilmore (Author)

Beginning PHP and MySQL 5: From Novice to Professional, Second Edition offers comprehensive information about two of the most prominent open source technologies on the planet: the PHP scripting language and the MySQL database server. Essentially three books in one, this second edition covers PHP 5, MySQL 5, and how these two popular open source technologies work together to create powerful websites. The book is packed with practical examples and insight into real-world challenges. It is based on the author's 7 years of experience working with these technologies. You will repeatedly refer to this book as a valuable instructional tool and reference guide.


Saturday 28 July 2018

PHP: The Complete Reference

PHP is a server-side programming language mainly used for web development and is also used as a general purpose programming language. It has become a rage in the Internet world. PHP: The Complete Reference, as the name suggests is a complete reference guide to the widely popular PHP.
This book deals with explaining how to personalize the PHP work space, define operators and variables, manipulate strings and arrays and the way in which one can use HTML. It also covers details on how to access database information, track client-side preferences using cookies, execute FTP and e-mail transactions and publish your applications to the Web. Additionally, this book deals in PHP's next generation Web 2.0 design features including AJAX, XML and RSS.
One can also learn to use PHP's object-oriented tools to build blogs, guest books and feedback pages with server-side file storage. PHP: The Complete Reference is a step by step guide to mastering PHP. Starting from the basic to the most advanced level, this book covers each aspect in great detail. This book was published by McGraw-Hill Education on 30 November 2007 and is available in paperback.
Key Features
  • Detailed coverage of PHP's next-generation Web 2.0 design features, including AJAX, XML and RSS is included.




Your One-Stop Guide to Web Development with PHP--Covers PHP 5.2
Build dynamic, cross-browser Web applications with PHP--the server-side programming language that's taken the Internet by storm. Through detailed explanations and downloadable code examples, this comprehensive guide shows you, step-by-step, how to configure PHP, create PHP-enabled Web pages, and put every advanced development tool to work.
PHP: The Complete Reference explains how to personalize the PHP work space, define operators and variables, manipulate strings and arrays, deploy HTML forms and buttons, and process user input. You'll learn how to access database information, track client-side preferences using cookies, execute FTP and e-mail transactions, and publish your applications to the Web. You'll also get in-depth coverage of PHP's next-generation Web 2.0 design features, including AJAX, XML, and RSS.
  • Install PHP and set up a customized development environment
  • Work with variables, operators, loops, strings, arrays, and functions
  • Integrate HTML controls, text fields, forms, radio buttons, and checkboxes
  • Accept and validate user-entered data from Web pages
  • Simplify programming using PHP's object-oriented tools
  • Build blogs, guest books, and feedback pages with server-side file storage
  • Write MySQL scripts that retrieve, modify, and update database information
  • Set cookies, perform FTP transactions, and send e-mails from PHP sessions
  • Build AJAX-enabled Web pages
  • Draw graphics on the server
  • Create XML components and add RSS feeds

About the Author

About the Author: Steven Holzner is an author of over 100 technology books, many of which are bestsellers. His works mainly pertain to online applications and components of Ajax including JavaScript, XML, browser objects and Web services. Steven also teaches programming classes at Fortune 500 companies and has also been a faculty at the Cornell University and MIT. His well known works include books like Ajax For Dummies and the Ajax Visual Blueprint. Steven has also worked as a contributing editor for PC magazine.


Friday 13 April 2018

What is cookie?


  • 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 request a page with a browser , it will send the cookie too.

    How to use a cookie


    Here,  Set a cookie.
    Program:-
    <?
    $time=time();
    echo $time;
    //setcookie(name , value , expire)
    setcookie(‘student’ , ‘mark’ , ‘$time’)
    ?>

    OUTPUT:-
    1407535797

    <?
    $student=$_COOKIE [ ‘student’ ];
    echo $student;
    ?>

    OUTPUT:-
    mark

How to use session in PhP


  • A session is a way to store information ( in the form of variable) to be used multiple pages.
  • A PhP session variable is used to store information about, or change setting for a user session.Session variable hold information about one single user, and are available to all pages in one application .
Program:-
<?php
session_start();
$_session[‘Name’]=’Castor classes’;
$_session[‘Age’]=’23’;
$_session[‘Weight’]=’47’;
echo “Done”;
?>

OUTPUT:-
Done

How to use global variable with function



PROGRAM:-
<?php
$name=”Castor Classes”;
echo $name;
function DisplayName()
{
global $name; # This is a global variable.
echo ‘ The name of online courses is Php’ .$name;
}
DisplayName(); #Call function
?>

OUTPUT:-
Castor Classes The name of online courses is PhpCastor Classes

How to use in-built function in PhP


Program:-

<html>
<head>
<meta charset=”UTF-8″>
<title>Castorclasses.com</title>
<style type = “text/css”>
</style>
</head>
<body>
<?
$username=”irawen.info@gmail.com”;
$entered= strtolower (“irawen.info@gmail.com”);
if($username==$entered)
{
echo “correct”;
}
else
{
echo “Please check your username”;
}
?>

How to use a basic function in PhP

Function:-A function is a block a code designed to perform a particular task.
Use:-To increase the readability of program and to perform a task repetitive manner.
Example:-
<?php
function hello_world()
{
echo”Hello world <br>”;         //This is a declare a function
echo”Hello world <br>”;
echo”Hello world <br>”;
}
hello_world();
?>

OUTPUT:-
Hello world
Hello world
Hello world

How to use function with return value

Program:-
<?php
function add($num1,$num2)
{
$result add  $num1 + $num2;
return result;
}
$add1=add(550+1000);
echo add (550,1000).'<br>’;
$add2=add(560+1000);
echo add (560,1000).'<br>’;
echo $add1*$add2;
?>

OUTPUT:-
1550
1560
2418000

Switch Statement use in PhP


  • PHP switch statement is used to execute one statement from multiple conditions. It works like PHP if-else-if statement.
Syntax:-
switch(expression){
case value1:
 //code to be executed
 break;
case value2:
 //code to be executed
 break;
……
default:
 code to be executed if all cases are not matched;
}

Example:-
 
<?php
$num=20;
switch($num){
case 10:
echo(“number is equals to 10”);
break;
case 20:
echo(“number is equal to 20”);
break;
case 30:
echo(“number is equal to 30”);
break;
default:
echo(“number is not equal to 10, 20 or 30”);
}
?>

Output:
number is equal to 20

Loop use in PhP

For Loop

  • PHP for loop can be used to traverse set of code for the specified number of times.
  • It should be used if number of iteration is known otherwise use while loop 
  • Syntax:-
            for(initialization; condition; increment/decrement){
            //code to be executed
               }

Example:-
<?php
for($n=1;$n<=10;$n++){
echo “$n<br/>”;
}
?>


OUTPUT:-
1
2
3
4
5
6
7
8
9
10

While Loop use in PhP

  • while loop can be used to traverse set of code like for loop.
  • it should be used if number of iteration is not known.
syntax:-
while(condition){
//code to be executed
}
another  syntax:-
while(condition):
//code to be executed
endwhile;

Example:-
<?php

$n=1;
while($n<=10){
echo “$n”;

$n++;

}

?>


OUTPUT:-

1

2

3

4

5

6

7

8

9

10

How to array use in a PhP?

  • Array is a collection Similar data,Basically array is use for group of value.
Example:-
<?php
$names=array(‘mark’,’john’,’bob’);
echo $names[1];
?>

OUTPUT:-
john

  • The another methods is-
Example:-
<?php
$names=array(‘Mark’,’John’,’Bob’);
$names[3]=’July’;                                  //This is use for add another value.
$names[4]=’Castor Classes’;                 //This is use for add another value.
print_r($names);                                   //Print all value on output screen.
?>

OUTPUT:-
Array ( [0] => Mark [1] => John [2] => Bob [3] => July [4] => Castor Classes )

Multidimensional Array in PhP

  • PHP multidimensional array is also known as array of arrays. It allows you to store tabular data in an array. PHP multidimensional array can be represented in the form of matrix which is represented by row * column.
Syntax:-
$emp = array
  (
  array(1,“sonoo”,400000),
  array(2,“john”,500000),
  array(3,“rahul”,300000)
  );
Example:-
<?php
/*
students
Name Age Weight
Mark 15 46
John 13 65
Tom 14 56
*/
$students=array(array(‘Name’=>’Mark’,’Age’=>15,’Weight’=>46),
array(‘Name’=>’John’,’Age’=>13,’Weight’=>65),
array(‘Name’=>’Tom’,’Age’=>14,’Weight’=>56));
echo $students[0][‘Name’].’ ‘;
echo $students[1][‘Age’].’ ‘;
echo $students[2][‘Weight’].'<br>’;
echo $students[0][‘Name’].’ ‘;
echo $students[1][‘Age’].’ ‘;
echo $students[2][‘Weight’].'<br>’;
echo $students[0][‘Name’].’ ‘;
echo $students[1][‘Age’].’ ‘;
echo $students[2][‘Weight’].'<br>’;
?>

OUTPUT:-
Mark 15 46
Mark 14 65
Mark 13 56

How can use Comparison operator and Logical Operator?


  • The Comparison operator is used for compare between two number.
  • There are study a  some operators:-

    Example:-
    <?php
    $number1=’10’;
    $number2=10;
    if($number1==$number2)
    {
    echo “Equal”;
    }
    else
    {
    echo “Not Equal”;
    }
    ?>
    OUTPUT:-
    Equal

    Logical Operators
  • The logical operator is used for logic apply between to equation.
  • Here, we are see a some operators:-


Example:-
<?php
$number1=20;
$number2=10;
if(($number1>$number2)and($number1==$number2))
{
echo “Equal”;
}
else
{
echo “Not Equal”;
}
?>
OUTPUT:-
Not Equal

Wednesday 11 April 2018

If , else and nested if/else Statement


  • If statement is a compare a statement and equality two number.
  • Here, we are check a if / else condition.
Example:-
<?php
$number1=10;
$number2=20;
if($number1==$number2)
{
echo “Two number are equal <br>”;
}
else if ($number2>$number1)
{
echo “number2 is greater than number1 <br>”;
}
else
{
echo”Two number are not equal <br>”;
}
?>

OUTPUT:-
number2 is greater than number1

Arithmetic operation


  • In arithmetic operation we are use a four operator
             —>ADD (+)
             —>SUBTRACT (-)
             —>PRODUCT(*)
             —>DIVIDE (/)
  • Here we are see a perform all operation.

Example:-
<?php
$number1=1009;
$number2=2003;
echo”ADD<br>”;
echo $number1+$number2 .'<br>’;
echo”SUBTRACT<br>”;
echo $number1-$number2.'<br>’;
echo”PRODUCT<br>”;
echo $number1*$number2.'<br>’;
echo”DIVIDE<br>”;
echo $number1/$number2.'<br>’;
?>

OUTPUT:-
ADD
3012
SUBTRACT
-994
PRODUCT
2021027
DIVIDE
0.50374438342486

Concatenation operator and Escape sequences


Here, we are use a Google link through a “HTML”

Example:-
<?php
$value=25;
$name=”Castor Classes”;
echo “Hello=$name <br>”;    //<br> is use for a next line.
echo ‘Hello=’ . $name . ‘<br>’;
$google=’Google Link’;
echo ‘<a href="http://www.google.com">’.$google.'</a> <br>’;  //This is a HTML code.
echo ‘It’s a nice day’;
?>

OUTPUT:-
Hello=Castor Classes
Hello=Castor Classes
Google Link
It’s a nice day

Variable Declare


  • PHP variable must begin with a “$” sign.
  • Case-sensitive ($Boo!=$b00 !=$BOo)
  • Global and locally-scoped variable
            Global variable can be used anywhere
            Local variable restricted to a function or class
  • certain variable names reserved by PHP
            Form variable ($_POST,$_GET)
            Server variable ($_SERVER)
            Etc.



Example:-
<?php
$value=25;
$name=”Castor Classes”;
$value=($value*8);
echo “$name”;
echo $name,$value;
?>

OutPut:-
Castor ClassesCastor Classes200

Here, $value is use for integer variable and $name is string variable.

Monday 19 February 2018

Introduction of PhP

Understanding Through the Definition

PHP is a server-site scripting language designed for web development but also used as a general- purpose programming language.
The PHP hyper text preprocessor (PHP) is a programming language that allows web developers to create dynamic context that interacts with database.PHP is basically used for developing web based software application.

Where PHP can be use

PHP code may be embedded into HTML code , or it can be used in combination with various web template systems , web content management system and web frame work.
We can make E-commerce , content management system , object oriented programmers which can run on the web.
Best live example of PHP is "Facebook". yes Facebook is developed in PHP , so now you can imagine what php can do.

What is Required ?

1) One Laptop / Computer
2) Text editor (i.e Brackets , Notepad++ , Dreamweaver etc)
3) Wamp or Xamp Server
4) Web browser ( Firefox , Chrome etc)

Why should I use PHP?


It is free to download and use.
Most famous CMS are PhP based,

For Example:-
  • WordPress
  • Joomla
  • Drupal
PhP is used on more than 24 millions websites.
Top websites using PhP
  • Facebook
  • Yahoo.com
  • Wikipedia.org
  • FLICKR.com
What should you already Know
  • HTML
  • CSS
  • JQuery (Optional)

How to run PhP Program?

  • First we are download a “wamp server” from google,then install a server.
  • The sign of wamp server is show on toolbar. It is show a green color.
  • Click a wamp server, then start a Myadmin button.
  • Write a Php Program in wamp server

    Simple Starting Code in PhP

    Example:-

    <?php
    echo “<h1>Hello, PHP!</h1>”;
    ?>

    Here, “echo” function is use for print the value on output screen.

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (112) C (77) C# (12) C++ (82) Course (60) Coursera (176) coursewra (1) Cybersecurity (22) data management (11) Data Science (85) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (5) flutter (1) FPL (17) Google (18) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (43) Meta (18) MICHIGAN (4) microsoft (3) Pandas (3) PHP (20) Projects (29) Python (719) Python Coding Challenge (155) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses