PHP Programming 101

December 16th, 2008

ステータスコードの数値

Posted by Conrad in Information


画像元:yourhtmlsource.com

応答ラインはリクエストは成功したかどうかを示ものだ。 これにはどの様なプロトコルが使われたか、ステータスコードの数値とステータスコードの短い説明が記載されている。

例として:

HTTP/1.1 200 OK

私達もステータスコードの数値をブラウザで時々見かける事がある。 理由は様々だ。 この数値は私達にとっては意味が無い、もしくは単に意味が分からないのだが、これらは何かしらの意味を持っている。

ステータスコードの数値は次の様な範囲に分かれる:

100-199
現在のプロセス・ステータスの情報メッセージ
200-299
リクエストの成功
300-399
ドキュメント又は資料が移動されたためのリクエスト中断
400-499
クライアントエラー。リクエストが不完全、不適切または解決不可能
500-599
サーバーエラー:リクエストは有効であるがサーバーがそれを完了できなかった

気付いただろうか?私達が目にする最も一般的なメッセージ「404 Not Found」エラーは、単に貴方がリクエストしたドキュメントは存在しないという意味なのだ。 これには二通りの考え方があり、本当に存在しない、もしくはURLを間違って入力したからかのどちらかだ。 404を返すとき、一般的にはブラウザ既定のフォーマットで表示される。 リクエストが不成功の場合、時にはサーバーがエラーメッセージと共にエラーレポートの詳細を送信することもある。

November 25th, 2008

Navigate with PHP

Posted by Conrad in Information

Image Source: nusphere.com

It is undeniable that PHP is very efficient most especially for your web site design. You can use the functionalities of PHP for difficult implementations like blogs, forums, chats, shopping carts and user form interfaces. While this may all seem a difficult tasks to undertake, you will always have to remember that PHP was designed to provide easy use yet very effective. Thus it is widely used for web navigation. PHP can be used for your site’s header, side navigation and some page information at the bottom. this provides accessibility for users to go around your site with comfort and ease. It will just require you to understand the basic steps in writing the script. It is not at all that hard, if you really come to understand its basic principles.

October 8th, 2008

Php? How does it work?

Posted by Conrad in Information


Image Source:technical-itch.co.uk

What are the uses of Php in the whole computing thing? We might wonder. The answer is simple. Php is practically used everywhere. It is being adapted to multiple platforms. The scripting language has revolutionized the way we communicate within the internet. Php reads and writes files. It is used to execute basic directory and file monitoring and maintenance. Simply put, Php has enabled developers and programmers and users to do things that wasnt possible to do in the web the previous years, like editing specific documents and files remotely. It is used to search files. Collect them and for the information stored in that file to remain there and retrieve it when needed. Now, information is more accessible. It does not require to be coded to a certain database. It can generate HTML and PDF files. It can process XML for HTTP. Its amazing capability to function on different data source makes it the idela tool for search engines.

August 10th, 2008

HISTORY OF PHP


Image sOurce:www.foundationphp.com
PHP was created by Rasmus Lerdorf in 1994 and it was written in C programming language. He created PHP so that he can trace the people who visited his online CV. To make things easier for him to debug his program, he made it into an open source. Then, on June 8, 1995, Lerdorf combined PHP and his own Form Interpreter because of the growing needs of web pages. It was now called as PHP/FI, but generally known as PHP 2.0. Then, in 1997, Andi Gutmans and Zeev Suraski rebuilt the main parser. Before Andi Gutmans and Zeec Suraski rewrote the PHP’s core, PHP was widely known as “Personal Homepage”.

PHP was widely known as “Personal Homepage” until Andi Gutsman and Zeev Suraski Rebuit the main parser of PHP. And so, the acronym PHP was formally changed to PERL Hypertext Preprocessor. Then PHP 3 was released in 1998.

PHP 4 was released in May 2000 with a new core known as the Zend Engine 1.0. In July 2004, PHP 5 was released with the updated Zend Engine 2.0 and new features. PHP 6 was released in October, 20006.

May 30th, 2008

PHP BASIC CODING (cont…)

(cont….)

V. Operators in PHP

*Arithmetic Operators*

+ addition
- subtraction
* multiplication
/ division
% modulus (division remainder)
++ increment
– decrement

*Comparison Operators*
== equal to
!= not equal
> greater than
= greater than or equal
<= less than or equal

*Logical Operators*
&& and
|| or
! not

I know its self explanatory…

VI. IF….Else Statements

If (condition)
//*Things to be executed if the answer to the condition is true*//
else
//*Things to be executed if the answer to the condition is false*//

If…else statement is use if the user wants to execute a set of code when the condition is true and another if the condition is not true.

VII. Switch Statement

switch (expression)
{
case 1:
//*code to be executed*//
break;
case 2:
//*code to be executed*//
break;
default:
//*code to be executed*//
break;
}

Switch statement is use if you want to select one of many blocks of code to be executed. this statement is used to avoid long blocks of if…elseif..else.

VIII. Looping Statement

while(condition)
code to be executed;

While statement is used to execute a block of code if and as long as a condition is true

do
{
code to be executed;
}while (condition)

Do—while statement is used to execute a block of code at least once and it will repeat the loop as long as the condition is true.

for each (array as value)
{
code to be executed;
}

For each statement is used to loop through arrays.

I think this is already enough and it has added new knowledge to those who are new in PHP… good luck and happy coding…

php_2.jpg

image source: www.cass.rrhosting.com

May 29th, 2008

PHP BASIC CODING (cont…)

(cont…)
III. PHP Variables

$variablename=value;

Variables are used for storing values such as text string or arrays. And all variables in PHP starts with a ($) dollar sign. There are various rules to be follow before naming a variable. 1) A variable name must start with a letter or an underscore. 2) A variable name can only contain alpha-numeric characters and underscores. Special characters are not allowed. 3) A variable name should not contain spaces.

IV.PHP Strings

$wrd=”Hello World”;
print $wrd;

Strings variables are used for values that contain character strings. The only operator that can be used on string is concatenation denoted by the sign (.) period.

$wrd1=”Hello World”;
$wrd2=”Good day”;
print $wrd1.”".$wrd2

You can count the nos. of string with the function strlen().

Print strlen(”HelloWorld and GoodDay”);

to be continued…

php-designer3php-editorscom.jpg

image source: www.php-editors.com

May 23rd, 2008

PHP BASIC CODING

Here are some of the basic things to be in mind while coding your dynamic web pages using PHP.

I. PHP basic syntax

PHP is a script that is place inside a HTML document that’s why you need to put the basic codes of HTML such as and .
PHP is open with the (?)question mark followed by “PHP” and closed with a (?) question mark.

II. Displaying in PHP

In order to display a text in PHP you need to use the keyword ECHO or PRINT. all code line ends with a semicolon.

To be continued…

firefoxss23hqcom.jpg

image source: www.23hq.com

April 24th, 2008

Avoiding Spywares and Viruses

Posted by Edi in Information

Photobucket

Virus problems can be such a headache and could cost you money as well. How do we avoid these spyware and viruses?

Usually it is in what we download. Know what not to download meaning, pay attention and be careful on your downloads as they are usually the one containing viruses. You can do a virus scan first before downloading if possibles.

Keep windows up to date. Though it takes time as it is very slow, it helps prevent viruses.

Freewares are often bundles with spywares, so be careful.

Also, before opening flash drives, make sure to do a virus scan.

Hope this helps to keep your computer free from virus in more years to come.

April 19th, 2008

Understanding Cookies

Posted by Edi in Information

Photobucket

What exactly is a cookie? It’s not a food, in the computer world, a cookie is a small amount of information sent by a Web server to a web browser. They are sent back unchanged by the browser each time it accesses that server. They are used for tracking, storing, authenticating information regarding the users which include sites visited. They give capabilities that make the web easier to navigate. If you are using Microsoft’s Internet Explorer to browse, you can see all of the cookies that are stored on your machine. They are usually stored in a directory called c:\windows\cookies.

It is composed of a cookie name and cookie value. The setcookie function() can be used to send a cookie to a browser to request your PHP page.

March 31st, 2008

Writing HTML Forms

Posted by Edi in Information

Photobucket

For any web content developer, writing forms in html is a very beneficial skills that one should know. It allows users to submit and enter information. The info that users input are collected through html forms either via email or adding the info to the database.

First, create the form in a word program as you can easily convert it to html forms directly.

The form must start with < form > and end with the < / form >. The common processing for programs are CGI, MySQL Perl and PHP. The programs must be available in the web server for the form data to be processed.

The < input > tag is used to generate info from users. This can be used with various form elements.

Form can be submitted into the system using < form method="POST" action=" " > tag.

Forms can be as short and simple as questions by email or as complicated as a hundred page survey.

Next Page »

Bad Behavior has blocked 119 access attempts in the last 7 days.