Wednesday, 12 October 2011

PHP Tutorials:

Learn PHP (variables) lesson


What is the point of programming without variables? Her singing as quietly. So let's dive.


Variables take something that is ... well ... variable. The opposite of static (no change).


All variables in PHP begin dollars. How to count and $ $ numberOfClicks. You can use this:


<?php


$ NumberOfClicks = 0;


echo "The number of clicks." NumberOfClicks $. " <BR> ";


$ $ = NumberOfClicks numberOfClicks + 2;


echo "After math, the number of clicks." NumberOfClicks $. " <BR> ";


&gt;


The semicolon at the end of each line, I remember! Burns me every day.


So you set a variable as you would expect with the equal sign. How numberOfClicks = $ 0


Here is another concept that I added this is called string concatenation. Slapping stuff together for printing. PHP uses. to hold the wires together. I conclude by quoting a string to tell the PHP code is coming, do. operator, the variable, then the second point, and the string in quotes. Do not + to hit the wires together. IT does not work. This is a common problem when you switch to another language PHP. Strange things happen when you forget and use + instead of a point. You will notice that I put " <BR> "At the end: this is so when the browser test, we can read the output Remember. PHP spits out the browser to print the HTML is fine, and the browser will recognize it.


Now, I could have $ numberOfClicks + = 2, however, what I did. + Case = port number to a variable. Even -= faith.


Unlike some other languages, there is no "type" of variables in PHP. A variable can be a whole number of one second, a number with decimal places and the next minute a string (lots of letters and numbers) of the next. It makes me crazy, but it also makes PHP easy: no conversion between types as in Java and C.


Here's another example:


<?php


StuffToPrint $ = "Fred";


echo $ stuffToPrint. " <BR> ";


$ StuffToPrint .= "and Ethel";


echo $ stuffToPrint;


&gt;


written by:


Fred


Fred and Ethel


A variable can be a string that can be seen here, and we can add to the chain by a .=


Let me know if something does not make sense!

PHP Tutorial  (GET and POST Variables)
Introduction - PHP passing variables between pages

In the tutorial passing variables to php, there are only four arguments are based on How to get to the PHP variables from page to page using the


POST


GET


$ _SESSION


Arrays


Passing variables between scripts


From sending data to another page


Here's a simple example of how to move the PHP variable from one page to the POST method, and how to use the POST array Super global experience to make coding more efficient and less time. First you need a HTML form data collection pass. Here we collect the names of five at a time. Let's see how it works. What follows is an explanation of how an HTML form, for those of you who are new and learning PHP and HTML.


A form used to collect data from people. What data are collected using a form can vary greatly depending on the site of a person is running. mrarrowhead.com have a form at the bottom of each page to collect user feedback and comments on the site. When the button is used, the values ​​that the author has signed name = "" text box as attributes are the names of variables that lives in the server as this is known as super global arrays. For it is enough to know that these variables are global, and are usually sent to the script you have identified your form to use form tag action = "".

PHP Tutorial for Beginners

This article is about a scripting language. For other uses, see PHP 

PHP

PHP: Hypertext Preprocessor

Paradigm (s) imperative, object oriented, procedural, reflecting

Appeared in 1995, 16 years ago [1]

Designed by Rasmus Lerdorf

The PHP developers group

Stable version 5.3.8 (August 23, 2011, 45 days ago)

Example 5.4.0beta1 release (September 15, 2011, 22 days ago)

Dynamic typing discipline, poor

Larger implementations Zend Engine, the Phalange, Quercus, Project Zero, HipHop

Influenced by C, Perl, Java, C + +, Tcl [1]

Influenced RadPHP (formerly PHP4Delphi)

C language implementation

Multi-OS platform

PHP License

Custom extensions. Php,. Phtml. Php4. Php3. Php5. Phps

Php.net Website

Programming PHP 

PHP is a general-purpose server-side scripting language originally designed for web development for producing dynamic Web pages. To this end, the PHP code embedded in the HTML document and interprets the PHP web server with a processor module, which creates a document of a web page. It has evolved to include a line leadership and interface can be used in standalone graphical applications. [2], PHP can be used with most web servers and stand-alone interpreter, almost every operating system and platform free of charge. [3], a competitor of Microsoft Active Server Pages (ASP) server-side script engine [4] and similar languages, PHP is installed on over 20 million websites and 1 million web servers. [5]

PHP was originally created by Rasmus Lerdorf in 1995. The main implementation of PHP is now produced by the PHP Group and serves as a de facto standard for PHP as there is no formal specification. [6] PHP is free software distributed under the PHP license that is incompatible with the GNU General Public License (GPL) because of restrictions on the use of the term PHP. [7]

Although PHP originally stood in the "Personal Home Page", is now said to stand for "PHP: Hypertext Preprocessor", a recursive acronym


PHP Tutorial for Beginners - #2 - Basic Arrays, Variables, Echo, HTML