PHP Programming 101

April 30th, 2008

Spam Blocking in PHP

Posted by Edi in PHP

by: Larla

Photobucket

Here are some tips on blocking Spams. It might not work 100%, but it definitely would help.

Make a spam list of common site in spam posts. Though some spammers have so many URL at least it would be lessen if you are able to block some of them. With PHP, it is much easier. You can look for a common denominator. You can use PHP to filter through all the posts.

Website cookies. A common denominator with SPAMMERS is that they do not have website set cookies. You can code a cookie check in PHP and it might work to lessen the Spam.

With PHP it is easy to figure out how to block spam although it is still not totally eliminated at least it has lessen and maybe someday it will block out all spams.

April 27th, 2008

PHP Installation

Posted by Edi in PHP

by: Larla

Photobucket

You can download PHP and install in the windows system in http://www.php.net, which is the official Web site for PHP. After downloading. Unzip the file into a directory and that’s done.

To check if installation is okay, there are 2 execution interfaces, CLI Command Line Interface and CGI Common Gateway Interface. However, if you installed PHP in the \php directory, you can 1st try to check there.

Run “\php\php -v” command to check the Command Line Interface (CLI).

Run “\php\php-cgi -v” command to check the Common Gateway Interface (CGI).

If you see the PHP version on the screen with both commands, then the installation is okay.

With these, tips you can now try to install you PHP program and know how to check if it is installed properly.

April 24th, 2008

Avoiding Spywares and Viruses

Posted by Edi in Uncategorized

by: Larla

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 Uncategorized

by: Larla

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.

April 17th, 2008

6 Tips For Better Form Design (3/3)

Posted by Edi in PHP

By mheo soriano


INFORM THE USERS ABOUT INPUT LIMITS

When your database has a field limit, situate a size limit on a text box - this stops people from entering too much text only to find out that their data has been trimmed down by your database.

KEEP FORMS SHORT
Never make forms too long and verbose- this may cause confusion to people and may intimidate them.

TELL THEM WHERE THEY ARE
In case of splitting forms by pages, it is a good idea to let your visitors know how far they are through the process of form submission. This lets people know where they are at the process all times.

April 15th, 2008

6 Tips For Better Form Design (2/3)

Posted by Edi in PHP

By mheo soriano

ERROR HANDLING
When there is an error within a field, always put a notice next to it and a message at the top indicating the user about the error - if you don’t put the message at the top, people will not notice that there is an error, and if you don’t put a notice near the problem field, people might not tell it from the others.


MARKING NECESSARY FIELDS

Always mark required fields - either with bold text, or, more commonly, an asterisk *. This is to make the users aware that the essential fields must first be satisfied before proceeding to the next step.

To be continued…

April 12th, 2008

6 Tips For Better Form Design (1/3)

Posted by Edi in PHP

by mheo soriano

The use of forms is the main method in which users can send data to the scripts, so it is essential to get them right. Aside from the coding aspect of forms, there are a number of basic usability guidelines to follow to further improve the effectivity:

TABLES

The use of tables will make the layout of the elements appear neat and organized. Tables make the form easier to read, and it would also be easier to report individual errors that occur on fields. Also tables can also be utilized to give the form a design that would be pleasing to the eye without sacrificing practicality.

To be continued…

April 7th, 2008

The Client side and Server Side Validation (3/3)

Posted by Edi in PHP


By:mheo soriano

The Server-side data validation
The Server-side data validation means utilizing PHP to verify if good values have been sent to the script. Using server-side validation has almost the exact opposite advantages and disadvantages of client-side development:
Yes, it is more secure and works perfectly with all browsers, but it does so at the expense of slightly higher server load and slower feedback for users.

One big advantage of server-side validation is that you can use PHP - a language in which you have already familiarized with by now.
PHP has a wide variety of functions and language features modify strings, check numbers are within ranges, and so on. In addition to this, you can use PHP to connect to a database to check whether a username exists, for example, which is obviously impossible using client-side scripting.

April 5th, 2008

The Client side and Server Side Validation (2/3)

Posted by Edi in PHP

By:mheo soriano

However, the Client side Validation also has disadvantages. One of the main drawbacks is that client-side support for scripting languages varies, with some browsers supporting scripts very well, others supporting bits and pieces, and others supporting nothing at all. In addition to this, cunning users can disable the client-side checking in order to feed the system with bad data -One who is solely reliant on the Client-side checking, is more prone to attacks from hackers

Most client-side validations are completed using the special “onSubmit” event of a form, which grants one to run JavaScript code to handle form validation when the visitor attempts to submit the form. If the return is different from the code in onSubmit, web browsers will not continue on with submitting the form, this allows the prompting visitors to correct any errors before submission.

To be Continued…