PHP Programming 101

March 31st, 2008

Writing HTML Forms

Posted by Edi in Uncategorized

by: Larla

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.

March 30th, 2008

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

Posted by Edi in PHP

by:mheo soriano

In validating the input, there are two options:

1)validate on the client side using a scripting language, or
2) validate on the server side using PHP.

The Client side Validation
A scripting code can be written (most commonly JavaScript) that will verify if the form fields
contain good data before being submitted to the server, this method is the most oftenly used.
There are also two advantages in using client-side validation:
A) The users receive feedback faster (no need to go off to the server, process the information, then download another HTML page), and
B) This means that it also saves load on the server - more work is done on the client

To be continued…

March 26th, 2008

Online Auction PHP Scripts

Posted by Administrator in PHP

PHP Pro Bid

One program that will surely be most sought after on the web today would be auction scripts. Many sites from all over the world have been looking for scripts that can offer a similar flow that eBay and Amazon have been offering although to a different degree.

Ranging from bidding all the way to multiple payment modes, the various features that auctioning systems such as the PHP Pro Bid is surely something that can prove to be beneficial to both the owner and the market he wants to get over the web. Definitely something aspiring business makers on the web will have to check out.

(Source) PHP Pro Bid

March 24th, 2008

Start out with Basic PHP

Posted by Administrator in Basic Programming, PHP

PHP Basic and Startup

The best way to start any new venture especially in the world of programming is to check out basic commands and information. Surely, you have to understand the basic foundation before you can be able to step up towards the advanced stages of PHP scripting.

For the usual programmers, they normally want to jump the gun and get to the nitty gritty of PHP programming. While it is only normal, they may eventually find themselves backtracking towards the basics since when errors start popping up, they need to know the cause of it. In most cases, these errors come from basic command errors, a lot of which they overlooked in the beginning.

March 22nd, 2008

PHP Scripts on the Web

Posted by Administrator in Basic Programming, Sample Code

PHP Scripts on the Web

There are a lot of PHP scripts you can check out on the web. Some PHP scripts can even be downloaded and used on your own websites. Most of these scripts can be customized accordingly, but just make sure you save it as another file since in the event you have errors, you may find yourself having to revert to the original file.

You will be surprised at the number of scripts you can find on the web. A lot of them are good and others really basic. But the thing to get out of them is really the script design structure to which will help you learn. After seeing all of these, you will surely get yourself to write you very first PHP script to display on the Internet.

March 18th, 2008

PHP is for Everyone

Posted by Administrator in PHP, Programming

PHP Made Easy

Whenever we say programming, it all comes down to limiting it to the actual programmers who have fought long and hard to make sure that they are up to date with the latest software the technology world has to offer. While this is only normal, many people have had their curiosity aroused on PHP to the extent of trying to learn it through the use of simple logic.

PHP programming is similar to any other scripting language we have heard of. The only difference here would be the commands to be used. If you sum it all up, it all boils down to desire and logic while also familiarizing yourself with the new commands and lines that PHP software uses today.

March 15th, 2008

Good Domain Name (Part 2)

Posted by Edi in Uncategorized

by: Larla

Photobucket

4. Plurals, “The”, and “My” Forms of the Domain Name
If you have a domain name in mind but it is already taken, you can have alternate forms of the name using my, the or possibly a plural for example, if you want car.com but it is no longer available you can possibly have mycar.com, thecar.com, cars.com.
If you plan on going for these kinds of domain name, promote your site beforehand as usually people will tend to forget the affix (the,my) when doing searches.

5. .ORG, .NET etc.?
If you are using a domain other than that of .com, same thing for using affixes, promote you site as people are more familiar with .com and would most likely do these when searching for websites.
It is also good to have a local domain name like .co.uk, if your business is in the UK or .co.in for India.. You can benefit from these as people in the particular country knows that they are dealing with a local company.

The domain name should be easy to remember and something that would stick in people’s mind.

March 6th, 2008

Array_diff_uassoc Function

Posted by Administrator in Basic Programming, Sample Code

Next in line is array_diff_uassoc() function which compares two or more arrays while checking for differences before comparing the keys with a user-defined location. It then returns an array withthe keys and values from the first array(to which all the values were comapred against) it the function allows it. Syntax is as follows : array_diff_uassoc(array1,array2,array3….,function). with a sample below of how it is used.

function userdefined($v1,$v2)
{
if ($v1 === $v2)
{
return 0;
}
if ($v1 > $v2)
{
return 1;
}
else
{
return -1;
}
}
$a1=array(0=>”Dog”,1=>”Cat”,2=>”Horse”)
$a2=array(3=>”Dog”,1=>”Cat”,5=>”Horse”)
print_r(array_diff_uassoc($a1,$a2,”userdefined”));
?>

which results in the following output : Array( [0] => Dog [2] => Horse). For an example of the same function with two or more assigned arrays to the function:

function userdefined($v1,$v2)
{
if ($v1 === $v2)
{
return 0;
}
if ($v1 > $v2)
{
return 1;
}
else
{
return -1;
}
}
$a1=array(0=>”Dog”,1=>”Cat”,2=>”Horse”)
$a2=array(3=>”Dog”,1=>”Cat”,5=>”Horse”)
$a3=array(6=>”Onyx”,0=>”Dog”,5=>”Horse”)
print_r(array_diff_uassoc($a1,$a2,$a3,”userdefined”));
?>

Which in turn, gives you : Array ([2] => Horse )

So we see the different array_diff function variants and the diffeerent ways they are used to compare the values of one or more arrays with one another.

March 1st, 2008

Array_diff_assoc and array_diff_key Functions

Posted by Administrator in Basic Programming, Sample Code

The next array comparison functions is the array_diff_assoc(array1,array2,array3,array3…..), usage is similar with all of these array_diff functions varying only in the way the comparisons are done. Below is sample code for array_diff_assoc:

$a1=array(0=>“Mouse”,1=>”Cat”,2=>”Dog”);
$a2=array(0=>”Lizard”,1=>”Dog”,2=>”Cat”);
$a3=array(0=>”Dog”,1=>”Cat”,2=>”Mouse”);
print_r(array_diff_assoc($a1,$a2,$a3))
?>

Giving you : Array ([0] => Mouse [2] => Dog).

Next we have the array_diff_key() function compares two or more arrays and returns an array with the keys and values from the first array only if the key is not present in the other arrays. Syntax is array_diff_key(array1,array2,array3……)which is similar to the other array_diff functions.

Sample usage:
$a1=array(0=>“Mouse”,1=>”Cat”,2=>”Dog”);
$a2=array(2=>”Fish”,3=>”Rat”,4=>”Bee”);
$a3=array(5=>”Dog”,6=>”Cat”,7=>”Fish”)
print_r(array_diff_key($a1,$a2,$a3));
?>

Giving you : Array([0] => Mouse [0] => Cat)