PHP Programming 101

April 30th, 2008

Spam Blocking in PHP

Posted by Edi in PHP

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

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 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.

April 7th, 2008

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

Posted by Edi in PHP

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


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…