Category Archive: php tutorial

Jun 20

HOW TO MAKE LOGIN FORM (register.php)

In this lesson, we build register form for our registration page. This is the code to make the form: name it “register.php” <form id=”form1″ name=”form1″ method=”post” action=”validate.php”> <p> </p> <p> </p> <div align=”center”> <table width=”50%” border=”0″ cellspacing=”2″ cellpadding=”2″> <tr> <th colspan=”2″ scope=”col”><div align=”center”>REGISTER FORM</div></th> </tr> <tr> <th width=”49%” scope=”row”><div align=”left”>USERNAME</div></th> <td width=”51%”><label> <input type=”text” name=”username” id=”username” /> …

Continue reading »

Jul 23

How to get user’s IP and hostname in PHP

To get user’s IP and hostname:

Jan 29

PHP tutorial Part8

INSERT THE ANOTHER PAGE on PHP You don’t have to rewrite the same code in every page in your web if the code is must be declare in every page. You can use INCLUDE or REQUIRE to call the other page, so you don’t have to write on every page the same code. INCLUDE to …

Continue reading »

Jan 29

PHP tutorial Part7

KNOW ABOUT POST After you learn about HTML, you will know that HTML has method “POST” to send information for from PAGE into another page. For example: Previous.php <html><body> <form action=”next.php” method=”post”> <input type=”text” name=”var” size=”25″/> <input type=”submit” value=”Submit”> </form> </body></html> In other page (next.php) you can get the value of variable that declared in …

Continue reading »

Jan 29

PHP tutorial Part6

LOOP Loop is used to repeat the PHP codes. If you want to repeat the codes of PHP for several conditions, you don’t have to write it all, just use loop. WHILE While is used to loop the codes inside the {} when the condition is TRUE. For example: <? $a = 1; while ($a …

Continue reading »

Jan 29

PHP tutorial Part5

CONDITIONAL STATEMENT IF The syntax to write “IF” function in PHP is <? If (condition){ statement;} ?> The code above, when the condition is right, so the system will execute the statement. If not, the system will neglect the statement inside the {}. If you want to make another statement if the condition is FALSE, …

Continue reading »

Jan 29

PHP tutorial Part4

ARRAY Array is Index that allows you to make one variable for variety of value. Array can be declare with numeric or string. For Example: or

Jan 29

PHP tutorial Part3

Arithmetic Operator There are several operator for Arithmetic that we use on PHP. Like others programming language, PHP have common operator. (+) adder: (-) subtract: (/) divider : (*) multiplier : (%) mod: For example: TRUE AND FALSE Compare the variable is used to make decision of the program. You can use the comparison for …

Continue reading »

Jan 29

PHP tutorial Part2

Syntax of PHP When you start to write PHP, you must type the ‘box’ so that code of PHP can be read by the webserver. Example: <? . . . . ?> Write word in php If you want to start write in PHP (not in HTML mode), you should put “echo” in order to …

Continue reading »

Jan 29

PHP tutorial Part1

What is PHP? From any information from official site of PHP, PHP is Hypertext Prepocessor. PHP is language of programming that can be inserted into HTML script. Many of the syntax is like C language, Java, and Perl. The purpose of PHP is help the developer to build a dynamic web. PHP usually used to …

Continue reading »

Older posts «