JavaScript Object Oriented

It may be shocking news, but JavaScript is a very powerful object-based (or prototype-based, whatever you wish to call it) language. Yes, JavaScript is a powerful language, not just something that’s handy for image rollovers and other corny, flashy effects. However, very few people who have used JavaScript realize its capabilities. If you’re one of these people, this tutorial is aimed at you.

First of all, JavaScript is not a full-blown OOP (Object-Oriented Programming) language, such as Java, but it is an object-based language. So, why should you use objects? Not only do they help you better understand how JavaScript works, but in large scripts, you can create self-contained JavaScript objects, rather than the procedural code you may be using now. This also allows you to reuse code more often.

Read the full article by Ryan Frishberg

Easy way to make your website render same across browsers

Even if it is not yet proved beyond doubt that W3C validation grabs better search engine rankings, it is sure that errors in your code will surely cause problems. Converting website pages to XHTML will help to reach more customers, as the site will work in more browsers and even non-traditional devices.

W3C, the World Wide Web Consortium, provides guidelines based on best practice, towards how websites and web pages should be authored in a structured manner to ensure long–term compatibility. The W3C validation is a standard for specified machine language, checking web documents, code grammar, syntax etc.

Continue reading “Easy way to make your website render same across browsers”

PHP HTML Form Generation and Validation

A PHP class for HTML easy form generation and validation. It provides an easy and intuitive way of handling both HTML form design (based on templates) and basic server-side form validation. Custom validation (both server-side and client-side) can also be implemented very easily. It provides all the basic controls available in an HTML form like text controls, textarea controls, submit buttons, reset buttons, standard buttons, drop down boxes, radio buttons, checkboxes, image controls, hidden controls, file upload controls, password controls and a date picker control.

View Website

Form Tools

Form Tools is written for web developers who work on online registration sites, or sites that require any form of information gathering from their online visitors. Put simply, it is a form processor, storage and data access script written in PHP and MySQL, designed to work with any existing web form. With a few minor changes to your form, you can stop using old-fashioned form-mail scripts and instead store form submissions in a database, instantly providing your clients with options such as mass data export via Excel, printer-friendly pages, data searching and sorting, form submission editing and optional email of form submissions to administrators and users. Form Tools is available for free under the GNU public license. See the website for an online demo, documentation, support forums or just to download the code!

Visit Website

Month of PHP Bugs started

The Hardened-PHP Project is proud to announce the beginning of the Month of PHP Bugs. This initiative is an effort to improve the security of PHP. However we will not concentrate on problems in the PHP language that might result in insecure PHP applications, but on security vulnerabilities in the PHP core. During March 2007 old and new security vulnerabilities in the Zend Engine, the PHP core and the PHP extensions will be disclosed on a day by day basis. We will also point out necessary changes in the current vulnerability managment process used by the PHP Security Response Team.

AJAXification by js graceful degradation

Now the question was about a suggestion to have a balance between best designs considering a friendly URL, Ajax, and SEO. It was implied about some contradictory indications. With the discussion passing on to friendly URLs are great if for no reason than log analysis, however, friendly URLs are supposedly better for SEO also (besides all
the other stuff for SEO).

Suppose if you would like to start moving over to AJAX for CMS-related, stuff, such as loading a news article when the user clicks on a headline, and stil make the site really search engine friendly.

Basically, you have a regular tag link that goes to the location you want, but you also have an onclick javascript event for that link that does the ajax stuff and returns false so that the browser doesn’t request the href part of the tag. Ideally, you’ll have an onload event to your page that attaches all these onclick events to your links so that you don’t even have inline javascript. (Rob Marscher at NYPHP).

The added benefit to backloading your ajaxification is that regardless of js enablement, the user could right click your link and open in new tab or window or even bookmark it and it’s still a plain link that will open normally. (Mark Armendariz at NYPHP).

The overall suggestion is to use prototype.js, and some implementation to use asynchronous fetch.

Security Issues by PHP applications

PHP has become the most popular application language on the web, but common security mistakes by developers are giving PHP a bad name. Here’s how PHP coding errors have become the new low-hanging fruit for attackers, contributing to the phishing problems on the web.

PHP became one of my favorite languages because of how quickly one can write a highly functional, standards-based web application with a database back-end. Unfortunately, attackers are taking these applications down even faster than they appear.

Writes Kelly Martin, SecurityFocus read the full article

Borland’s RAD for PHP; to be or not to be

Borland’s wholly-owned spinoff CodeGear is releasing Delphi for PHP, claimed to be the first RAD visual PHP development environment. PHP 5.0 is required. The product is jointly developed by CodeGear and qadram software and is essentially the first production version of qadram’s qstudio, which never made it past pre-beta.

The IDE is a Delphi lookalike, built with Delphi but distinct from CodeGear’s BDS (Borland Developer Studio). The main point of interest is the component library called VCL (Visual Component Library) for PHP, formerly called WCL (Web Component Library), which is a set of PHP components modelled after Dephi’s VCL, supporting drag-and-drop form editing and customization with a property editor. Existing PHP libraries can easily be wrapped as new VCL for PHP components.

Read the whole story »

Use variables in SQL

What was that ?

Yes.. I mean use variables in SQL. This can be quite interesting, though there may be a lot of people who might comment, that this kills readability, or does not induce even a ray of benefit, well I am not into an argument. And the method I am testing only with MySQL. In several situations, it has proven to be more faster, and as of recent times, we have started to send the whole of the code as a single operation letting mysql to handle the query splitting.

Suppose we need to insert first into a login table, to generate the user_id, which is auto-increment, and then into a set of tables, normally, we would go around insert into the table, then use mysql_insert_id(), to get the last inserted id, to process the rest of the tables. Now think if we used


insert into [table1] (fieldnames) values (values);
select last_insert_id() into @ii;
insert into [table2] (fkId,fieldnames) values (@ii,values);
insert into [table3] (fkId,fieldnames) values (@ii,values);

There are several other example uses for selecting into a variable, but the limitations are that you can select only a single field and single row.

Any comments :

PHP – An Introduction

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP uses are widespread, and can include any kind of server functionality that takes user's input a

nd displays or manipulates the input. PHP has different ports, and supports Windows, Unix and Mac, which makes it more accessible than Microsoft Web Technology ASP. This scripting language is growing day by day. PHP5 a fully object oriented platform independent language. The speed on Linux server helps to build large and complex web applications.

What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server. If you were to have a script similar to the above on your server, the client would receive the results of running that script, with no way of determining what the underlying code may be. You can even configure your web server to process all your HTML files with PHP, and then there's really no way that users can tell what you have up your sleeve.
The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. Don't be afraid reading the long list of PHP's features. You can jump in, in a short time, and start writing simple scripts in a few hours.
Although PHP's development is focused on server-side scripting, you can do much more with it. PHP is not only used for web applications, but also to automate administrative tasks on webservers, like server management, automated backups, database related backups and cron job scripts, one such example is mysql incremental backup solution. Continue reading “PHP – An Introduction”