Templates and ready made Apps on the Web (Part 2)

June 26th, 2015

There are a lot of programmers who share code and sample applications which you can use for free (provided you clear it up first) but for budding programmers, they’re all there for the taking. Sites like <a href=”http://websitetips.com/php/”>websitetips.com</a>, <a href=”http://www.smartwebby.com/PHP/default.asp”>Smartwebby.com</a> and many other blogs and help sites allows access to tips from programmers like you making it a pleasant experience altogether. Can’t find a question, post questions to the many forums and you’ll get help from others in no time, you might even get help from the guru’s themselves who made the phenomenon that is PHP possible for all of us to use.

Array_diff Function

June 19th, 2015

The first function, array_diff() is used for comparing several tables or arrays which gives an array with the keys and values from the first array if the value is not available in the other arrays. Syntax is as follows : array_diff(array1,array2,array3……), where array 1 is the table to which all the other arrays will be compared to. The 2nd array(array 2) is an array that is compared with the first array and so on and so forth. Below is sample code of its use and the outcome of the functions comparison :

$a1=array(0=>“Mouse”,1=>”Cat”,2=>”Dog”);
$a2=array(3=>”Dog”,4=>”Cat”,5=>”Lizard”);
print_r(array_diff($a1,$a2));
?>

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

PHP programming jobs still in demand

June 12th, 2015

Technology Driven Marketing Solutions is an industry leading developer of PHP solutions who will become part of a dynamic and fast growing team. You may experience to make codes for a range of web applications by applying your PHP and OOD programming. Success in this field will lead to further career opportunities within the organization.

Control Structures

June 5th, 2015

There used to be an old saying in PHP that a control structure needs a single constant to locate it and a set of brackets to clear it all up. Well, that might all be true but using too many of these curly brackets when it isn’t needed at all doesn’t help you any and it even makes your code a tad bit harder to understand. Let’s show this with the following example:

if ($superman == ‘alien’) {
$strength — ;
}

Saying that, it would be simpler to code it in this simpler more readable manner:

if ($superman == ‘alien’) $strength — ;

The fewer brackets that muddle up the code the better for it makes it all the readable thus easier to understand and fix in case something goes wrong.

Array Count Values

May 29th, 2015

The array_count_values() function returns an array which contains the keys of the original array’s value and the value is the number of occurences. A sample of it’s use is shown below:

$a=array("Mouse","Cat","Dog","Cat");
print_r(array_count_values($a));
?>

Which would give us an output of : Array ( [Mouse]=> 1 [Cat]=> 2 [Dog]=> 1 )

The next functions are used to compare the contents of one array against one or more arrays either returning the key, keys and contents or solely the contents of the specified fields that result from their comparisons. They are array_diff(), array_diff_assoc(), array_diff_key(), array_diff_uassoc() and array_diff_ukey(). all of these are used to determine the difference between a set of arrays returning either the keys or contents to give the results of the said array comparison/s.

Phishing Scmas and others exploit PHP Vulnerabilities

May 22nd, 2015

Security is always the main issue that is more than often over-looked when it comes to developing web-based applications. And with PHP being the most favorable attack platform available on the internet to date, hackers normally rely on the weakness of security that is very much lacking in the many web pages that are being hijacked by hackers for phishing and other malicious attacks to steal information. There is however one issue that everybody must understand, we are all to blame for this beginning with programmers for any program written on any language that is commonly used over the internet is weak if it is not designed and adapted to evolving threats.
This is an issue of responsibility which seems to be lacking greatly in the many development labs who only act on older projects should the clients decide to fund such retro-fitting. The concession is to allow the problems of old be and to focus on new ones, which maybe hoping for these problems to simply fade away into history but as we have found with the many botnets that have been found to be running for years on old derelict computers, they can haunt us with a vengeance.

Further shortening of your code (Part 1)

May 15th, 2015

Many people are using PHP for development and most have truly mastered the art of programming the easy way round. Sadly, many older web sites that used these older styles of programming are not only long but reminiscent of reading something similar to alien writing that is long and incomprehensible to the layman. But good for all of us, there are some people out there who are willing to share their learned ways to those who are just beginning to master the strengths and powers of PHP. The traditional PHP way of checking for Boolean expressions was long and filled with those double equal signs (==)and others that were akin to some other mathematically adept languages but there are simpler ways of doing things as there always is with any language. In the next post we would give and example of the concept.

PHP Programming Tutorials & Tips

May 8th, 2015

One of the more popular technologies for web programming in the recent years owing to its open source technology is the PHP. And it only means that it’s free to use and also compatible with almost any server, say Windows, Linux/Unix and Apache. This technology has many advanced features included in it though its open source.

Extracting More from PHP with the QB Extenstion

May 1st, 2015

QB logoOne of the weaknesses of PHP is that it isn’t doesn’t perform to well when used to develop computationally intensive tasks. Sure, its great for even the most complex of web applications, but is often skipped over in preference of another language for when it comes to computing.

An extension for PHP called QB, remedies this problem “by translating Zend opcodes and executing them through a statically typed virtual machine” resulting in a significant gain in performance even for complex tasks such as pixel-level image manipulation.

If you are new to PHP though, barely understanding the array chunk function, dabbling with PHP+QB is not advised and would be akin to handing your platinum credit card over to a teenager for use; perfect recipe for a disaster. Advanced programmers could benefit from this though it is recommended that you have a pretty fast system once you start compiling since compiling QB from source code is quite memory extensive, requiring at least 2 gigabytes of memory.

Photo Credit

Write secured PHP

April 24th, 2015

Image Source:sitepointstatic.com

PHP programming was written to be an easy language to program. Completely opposite to being very security oriented. It was so until the 4.1 version. Undeniably, Php has grown to be popular in the short term. But it also created many, many, very badly written scripts. And it gave a very big number of programmers a mindset which is not inclined to the security aspect of programming. Maybe, the main reason behind it, is the automation of conversion by PHP of inputted data to script variables using or enabling though php.ini setting register globals. In the 4.1 version of PHP, this type of behavior was left enabled but was not recommended to be used. With PHP 4.2, this type of behaviour was disabled by default. It broke thousands and thousands of scripts worldwide. This dilemma led to forcing the coders to write more secure codes. They made scripts break. This was opposed stongly before but somehow they saw that the move was a smart one.