Source: Drupal.org via google images
A beginners guide in Learning PHP
This hub offers the step by step processes on how to program using PHP. You can program or make PHP scripts on PHP editors, such as Notepad++ and Netbeans IDE. If you do not know what PHP is, and what you need to learn about PHP; you can read this hub first. In learning PHP, it is advisable to know a bit of HTML Basics. HTML wouldl help you a lot in understanding PHP better.
Anyway, granted you already have a background on HTML Basics; let’s now start learning PHP.
I used to code PHP scripts in Notepad++ as well as in Netbeans. For the beginners, coding in Notepad and/or Notepad++ is the best way to sharpen their skills in coding PHP. Because using those editors require hard coding. It means no drop and down features, which are essential on the beginner’s learning in using and manipulating the language well.
See all 5 photos
Source: oss.sgi.com via google
Don’t Mess With Programmer Shirts
S.Horizon-Don’t Mess With Programmer – T-Shirt~Orange~Adult-MD
Amazon Price: $19.95
S.Horizon-Don’t Mess With Programmer Baseball Jersey~Heather/Navy~Adult-LG
Amazon Price: $24.95
S.Horizon-Don’t Mess With Programmer Ringer T-Shirt~Sport Gray/Navy~Adult-SM
Amazon Price: $24.95
S.Horizon-Don’t Mess With Programmer on Men’s Tank Top Cotton~Royal Blue~Adult-LG
Amazon Price: $19.95
Before Coding, What You Need To Do First?
1. Open a Notepad++ or Netbeans editor. But, I suggest you use Notepad++. If you do not have this editor yet, you can google and download notepad++ for free. Just type on google search box the notepad++ free download.
2. Open the PHP server, preferably XAMPP. IF you do not have XAMPP, download free XAMPP also. If you have XAMPP but do not know how to use it. Read on how to run php code with XAMPP here.
Granted that you already done the requirements above. Now let’s begin on learning the PHP basics.
The Steps on How to Program Using PHP
Step 1. Use the PHP Opening and Closing Tags
PHP like other scripting and server-scripting languages has also its own opening and closing tags. Without it, the PHP codes or scripts would not be executed by the PHP servers. So in coding PHP, it is important to note that before you can make any PHP scripts you should type first the opening and the closing tags.
Opening Tag:
Closing Tag: ?>
See code below:
Step 2. Know How to Declare Variables in PHP
PHP has also it own share on how to declare variables. The function of variables in PHP is similar as the other programming languages. They are also meant to hold numbers, characters and string. However PHP has no data types. The declaration of variables comes with the dollar sign ($), name of the variable and ends with semi-colon (;). If you want to instantiate a variable with a string, or character, or number, see the code below for the right declaration.
//sample for declare variables
//sample on how to instantiate variables with value
Step 3. Input and Output on PHP
Before we go to how to read the input in PHP programming, let us look first on how to output a string of characters.
To output string, you can use the echo or print() function:
Example:
Sample Output:
See all 5 photos
PHP Video Tutorials
“Learn the PHP basics from 17 info packed video tutorials.” “On CD”
Current Bid: $1.99
PHP Programming Video Training tutorials CBT – 7+ Hrs
Current Bid: $4.99
Learn php -mysql and web develop video &docs tutorials
Current Bid: $5.99
PHP For Beginners Video Tutorials on CD
Current Bid: $13.60
To get the value of the input in PHP, the learner should at least know the basic of HTML. For we will be tackling about html forms here. The concern functions on getting the input in PHP are the the $_GET and $_POST built-in functions. These 2 functions were built to get the information entered by the user.
What is the difference and the similarity of $_GET and $_POST functions in PHP?
When a PHP Programmer use the $_GET to get the information, the information that would get by the $_GET function would be shown on the URL of the page, while the $_POST makes it invisible from the user’s browser.Clearly, the most secure to use in getting the input is the $_POST, though there are also situations that the $_GET seems the better one to use.
How to use $_GET and $_POST?
Good question. To use it, we must first design an html form. To make things simpler, my example is the signup.html that has only two input fields, the username and email address. See the code below.
UserName:
Email Address:
Sample Code Output
See all 5 photos
Now, to get the information entered by the user in those blank fields and by clicking the submit button, the $_POST on another PHP file named print.php would be used. Review the html form again. You would see this: , the action there means that after the user clicks the submit button, he/she will be directed to print.php file, while the POST on the method means that the $_POST function will be used to get the information entered by the user. You could also replace it by GET, if you want to use the $_GET function. The code for the print.php is the following:
The situation is this: If the user will enter his/her information on the signup.html and clicks submit, the user will be directed to the print.php which will display the new user and his/her email address. The print.php scripts get only the information entered by the user and display it on the browser. To understand better, refer to the photos below:
User enters her username and email address and clicks submit
See all 5 photos
User directed to print.php and the PHP file get and display the information entered by the user
See all 5 photos
Available PHP E-Book
EBook Download Store php scripts website #NP-0016
Current Bid: $6.69
Learn PHP and MySQL PDF Ebook And Video Tutorials Course With MRR on CD
Current Bid: $8.43
PHP Script Store with Products to sell (eBooks & add your own)
Current Bid: $9.95
If you want more example on $_GET and $_POST, refer to the link below this hub.
The Part II of this tutorial will include:
-Learning the different PHP Operators
-Learning Different PHP Operators
-Learning how to manipulate PHP Loops
The Part III of this tutorial will include:
-Learn how PHP Arrays behave
-Learn how to make PHP Functions
Are you interested in PHP Programming?
Yes
No
See results without voting
Protector Glasses For All Computer Users
BLACK OR BROWN WAYFARER COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
Anti-Stress COMPUTER GLASSES Brown WAYFARER Eyeglasses clear sunglasses gunner
Current Bid: $7.95
BLACK OR BROWN WAYFARER COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
BLACK OR BROWN COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
BLACK OR BROWN COMPUTER GLASSES-ANTI REFLECTIVE COATING- UV PROTECTION
Current Bid: $7.99
Other Sample Codes and Tips in Learning PHP
How to become a PHP Developer: Learn and Earn
How to run PHP Code or PHP Scripts and See the Result on Your Browser
HTML Basics: Learn The Basics of HTML and Create Your Own Webpage on Your Browser
PHP Sample Codes On Function:How to make Function in PHP
PHP Code Example on Associative Array and Multidimensional Array
PHP Code Example on Foreach Loop and For Loop
PHP Code Example on Do-while Loop
PHP Code Example on Numeric Array
PHP Code Example on While Loop
PHP Code Example on Switch Statement
PHP Code Example on if else-if Statement
PHP Code Example for if-else Statement
PHP code Example for if statement