Articles

Articles about php-programing

More than 20 million websites use PHP including eminent websites like Wikipedia and Facebook are built in PHP. This indicates the popularity of PHP as a language. The biggest opensource projects of the world WordPress and Drupal are belong to PHP. So naturally the numbers of PHP developers are greater than any other languages. In this article I would like to share some good habits to become a better developer than others.

 

Use PHP Core Functions and Classes

There are plenty of PHP core functions and classes available in PHP manual which can ease your work at greater extent. Chances are more when you want to do something that is common. Always checkout PHP manual before creating your own functions.

 

Create a Configuration File

It is better you have one master file for your database rather than many scatter files in your project this will allow you to edit, add or delete data whenever you need to. This is also useful when you need to use other constants and functions throughout multiple scripts. Using one configuration file is more popular pattern that makes code more modular and easy to maintain.

Sanitize Data before it Goes into Database

SQL injections are more common phenomenon than you may think. If you want to avoid it totally there is a prerequisite condition and that is sanitization of your database so you never encounter any problem later on. mysql_real_escape_string will take a regular string and sanitize it for you. If you use function together with htmlspecialchars, which converts reserved HTML characters, not only your database be protected, but also safe-guard your apps against cross-site scripting attacks when rendering user-submitted HTML.

 

Turned on Error Reporting During Development Stage

During development, leave error_reporting and display_errors turned on so you can know where errors come from. You can set up these run-time configurations in your server’s php.ini file.

 

Avoid Over Comment your Code

Using the comments is a good practice but try to limit the comments and avoid unnecessary comments in your code. Remember good code is self-explanatory most of the time.

 

Keep Favorite Code Snippets Handy

Repeated coding is common thing in your career and keeping your code snippet handy is good habit. It will save your time and effort. Some apps you can use to corral your code snippets are Snippet, snippely, Code Collector, and Snipplr. Eclipse and Dreamweaver have built in features for storing code snippets. Even you can use Dropbox for this purpose.

Shoaib Marfatiya is working with an eminent and professional PHP Application Development company named Peerbits. Peerbits offers services for PHP application development . At present Shoaib is exploring various topics on PHP Application development and would love to hear from you. If you are interested in PHP Application development and seek further assistance contact us.

Find More Php Coding Articles

Video scriptwritings equip users with the plan of action for video production, especially in the world of corporation where words need accepting before being produced. I have build 5 steps to ensure that my scripts help producers create the best video as the can- ones that work as that work as multimedia devices, take advantage of the medium, and inspire much the same way as a great movie or TV show.

 

 

1. You’re not on TV. And you are not the star. The least impressive form or video communications is the talking stand-up reporter approach. The writer or producer decides it would be fun to pretend they’re on 60 Minutes or CNN, hires a good voice or a pretty face to wear a trench-coat and business suit, and then proceeds to put words in their mouth telling us how great the product or company is.

 

How would THEY know?

 

Authority is important in any sale or marketing video, but authority comes from product features, end users, or company experts- not a can of hair spray. He or she might be cute, and might be the next Deborah Norville.

 

They just don’t belong in your video.

 

In addition, it’s cheating. For every second they’re standing there telling us about something, we could be seeing it, hearing it, experiencing it. And the production dollars saved? Enormous. But you’re cheating the audience and the audience knows it.

 

2. Words only when necessary. It’s easy to write a script. Go to Word, or Pages, or some other software and create two parallel columns. At the top of one type “Audio”. On the top of the other type “Video.”

 

See? Two elements- what’s seen and what’s heard.

 

Most often, we will begin writing with what’s heard, because that’s how we think it through. But why start with words? Why not start with a visual? Music? Sound Effect?

 

I remember a piece we did years and years ago.

 

It started with a sunrise, the chirping of birds, the sounds of turbines starting, and a loading dock door being opened. That took about 15 seconds. If we had used words to paint that picture, it would have taken perhaps a minute.

 

But now, all the announcer had to say was…..

 

“Dawn. At Leeson Motors.”

 

And the audience knew that this company takes the workday seriously, they have a large plant (exterior shot of the sunrise had the plant in the foreground), a fleet of trucks, and a zest for life.

 

Contrast that with just showing the logo and hearing an announcer say,

 

“Every Morning at Leeson Motors in Waukeegee, Ohio, we get to work early and appreciate the sunrise, see the dew on the grass, hear the birds, fire up the engines, open our doors, begin the shipping process, and thank the almighty that it didn’t rain today.”

 

In short, words only when necessary.

 

3. Write for the Ear. When words ARE necessary, write like you talk. No not those words. What I mean is, write conversationally. As we pointed out, words take time. And people don’t speak in complete sentences.

 

I remember writing a commercial that was a take off on the old cop show “Dragnet”.

 

My first draft began….

 

Offscreen VOICE OF FRANK: This is the city, Los Angeles, California. A nice place, at least most of the time. But on this day, on a routine patrol, my partner Frank and I spotted a suspicious character, his arms filled with loot. Books, records, a painting… it had to be a break in.

 

We got out of the car and I said….

 

FRANK (ONSCREEN): Hold it Mister, what have you got?”

 

There was just one problem with all this- the commercial was thirty seconds, and I had just eaten up all thirty seconds uses words to paint the scene.

 

After a short confab with one of my business partners, also a writer, we revised it thusly:

 

OFFSCREEN VOICE OF FRANK: The city. We spotted him. Books, records…. Had to be a break-in.”

 

FRANK, now onscreen: Hold it Mister, What have you got?”

 

The visuals, clearly called out in the VIDEO column, told the rest of the story nicely:

 

– Establishing Shot City
– Frank and Partner in police car
– Suspicious person walking down what might be a brick alley with arms loaded with Library items
– Cut to Joe and Frank (head and shoulders), with red light pulsing in background

 

FRANK, now on screen: Hold it Mister, What have you got?”

 

4. Give the audience a break. Every so often, take a breather. Run a short sequence of music and pictures, so they can catch up and absorb what you’ve thrown at them. This gets more complicated, but audiences can only handle so much, and if you distract them or wear them down, they won’t retain what your asking them to, or they might even rebel and turn their minds off.

 

5. End Big. This doesn’t mean World War II with the original cast, but it does mean to give your audience signposts so they know where they’re at in your video. I always use music to change the pace, but toward the ending, you need a finale, and finales don’t fade, they echo. A recap tells them its over, and a musical crescendo tells them it’s over. Music that ends in “threes”- restating the musical theme line three times- is pretty much a ta-da! Never leave them hanging, but always finish big, and finish before they’re bored. A good example is a meeting opener we produced for Underwriters’ Laboratories 100th Anniversary.

 

Note the ending of the music- it uses a “triple”- this builds emotion and sends the signal to anticipate what comes next, while indicating the this part of the meeting- the opening video- is over.

 

Scriptwriting is the backbone of the successful multimedia project. Knowing that words are only part of the equation will help you write or review scripts on a much higher level.

 

Brien Lee is President and Creative Director of Brien Lee Videostory, Inc., a New Jersey based communications and video production consultancy. An award winning writer-director, Brien has produced sales meetings, videos, web video, direct mail cd’s and DVD’s, and specialized in the creation of video-based websites that sell and inform his customers audiences. He has been in the communications business for more than 30 years, and has worked with companies like Walgreens, AT&T, Johnson Controls, Mercury marine, the Diocese of Metuchen, New Jersey, and others. His website can be found at http://www.videostory.com

More Php Scripts Articles

Some of most popular PHP frameworks have a small issue that they are quite heavy and appear to be a not so friendly for less experienced users. These frameworks contain a huge amount of libraries and extensions, thus are referred to as heavy due to the fact that they, but however there are also lightweight ones which exist, which prove to be equally beneficial. The available lightweight frameworks can effectively help in web and application development.

Some of the common lightweight frameworks, which successfully work for a wide range of development needs, are discussed below:

Kohana PHP Framework

 

 

 

 

It is widely referred to as fork of CodeIgniter framework and is a MVC-based PHP 5 framework.
The typical features used are in-built, but if certain functionality is required, it can be easily extended with the necessary tools and libraries.
It is mostly preferred by the developers due to the fact that it is every lightweight and is not dependent on other external libraries.
It does not include long configuration files or any other separate code generators.
Kohana seem to be driven by the community and most lengthy monolithic libraries have not been added in order to yield the most optimum results.

Fat-Free Framework

 

 

 

 

 

It is largely favored because of its uniqueness and the incredible features it includes, which helps to differentiate it from the rest.
The significant features are packed together in a bundle, where there are separate integration and extension modules for any requirement.
This also comprises a bandwidth meter, which helps to keep a check of the server traffic.
Going by its name, it is very fast and small, where its size is just 55 kb.
Its fat-free size has been acquired by uniting together necessary features into packages and modules for influential development.

DooPHP Framework

 

 

 

It appears to be one of the fastest lightweight frameworks, which uses MVC architecture and works effectively with PHP 5.
It is useful for the developers by not having to write much code, along with noticeable reduction in the cost of development.
DooPHP helps to create sites which can help bring in a huge amount of traffic and sites which load fast when compared to the rest, making it an SEO-friendly framework.
It comprises of a template system, which appears to be simple, but can manage complex development needs.

 

Above mentioned are a few lightweight frameworks, nonetheless there are many more which exist. In many cases there is no “one” best framework present, as each works better than the other in different situations.

The entire idea of a framework is about being versatile and interactive, therefore, proving its abilities in various situations. Moreover, PHP’s frameworks reduce a lot of time by efficiently utilizing code snippets defined earlier, encouraging re-usability. It is significant to make the right choice, based on your needs to help achieve high performance and quality applications. Hiring a PHP development India Company can help in successfully taking advantage of these frameworks, in order to take your business to great heights.

Smartkathy shares information about PHP technology and benefits of PHP development India. She loves to write on various web-based development tools and trends.

Categories

Join With Us