Wednesday, October 31, 2007

PHP Developers

How to Implement CAPTCHA With PHP and GD
By [http://ezinearticles.com/?expert=Andrew_Ivanov]Andrew Ivanov

So, you have a public submission form on your website (contact page, forum submission,blogs comment form) and need to prevent spam by auto-submitters. Common way to do this is to implement CAPTCHA - an image with randomly generated string
(quote from Wikipedia, free online enciclopedia: “A CAPTCHA is a type of challenge-response test used in computing to determine whether the user is human. "CAPTCHA" is an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart", trademarked by Carnegie Mellon University.”)

Simple, quick and efficient PHP solution for implemet CAPTCHA:

the advantage of this solution: it is easy to read symbols by human and automated captcha processor software, but hard to process the image by computer because common CAPTCHA processors can't understand which one of the outputted symbols it must ignore!

obviously you need PHP engine enabled for your webserver, for execute PHP scripts, and GD (PHP graphics library) for generate the image. Webserver, PHP and GD versions are no matter, the solution below is tested for Apache(Windows and Unix), IIS(Windows), PHP-4, PHP-5, GD, GD2

1) Make a PHP script (separate file captcha.php) which will generate the CAPTCHA image:
[?php
session_start();
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
function _generateRandom($length=6){
$_rand_src = array(
array(48,57) //digits
, array(97,122) //lowercase chars
// , array(65,90) //uppercase chars
);
srand ((double) microtime() * 1000000);
$random_string = "";
for($i=0;$i

Monday, October 29, 2007

PHP Developers

Choose Wisely: PHP Templates and Search Engine Rank
By [http://ezinearticles.com/?expert=Jacob_Filipp]Jacob Filipp

This article is intended for PHP web developers who create template systems for consistently presenting website content. PHP designers who create their own template systems should be concerned about how their choices affect the website's position in search engines. Below is a discussion of three types of systems, their impact on search ranking and a recommendation for the best approach.

Webpage as a CGI Argument

In this architecture one PHP script contains the entire template, and plugs in content from a file it reads in - getting the file name from a CGI parameter. These types of systems are not only prone to security problems (as users can modify the path argument to retrieve arbitrary files) but are also ineffective for search engine optimization.
This particular design does not allow for titles and keyword/description meta-tags to be associated with individual pages. This is because the header portion of the template includes the section within it, and only allows for one site-wide title and set of meta-tags. Titles are one of the most important page elements, and having one title - unrelated to the actual content retrieved - results in a lower rank in search engines.

There are two other detrimental SEO effects this type of system has. The first is that each unique page is viewed as an aspect of the template script, rather than as a unique standalone page. This can result in search engines lowering the importance of individual content pages relative to the template script - which is often not the desired result. The other weakness of this approach is that having individual pages set up as CGI arguments makes site metrics harder to track, as statistics often show a visit to a specific page as a visit to the general template script. The popular web statistics packages AWstats and Webalizer are most affected by this.

However, this type of templating system is popular and sucessfully used in the world of e-commerce. In such systems, product information is stored in a database and is inserted into the template when a product is requested by its code. This means that both a unique title and a set of meta-tags can be stored alongside the product data (or generated on the fly), and inserted into the global template effectively. The only detrimental effects that remain are the latter mentioned two, and are usually an acceptable tradeoff for the increased ease of administration that a database-driven system provides.

Template as an Include

In this architecture, each page on the website has its own filename with a .php extension. The top and bottom portions of the template are stored in separate files that are included (using include_once() ) by each content file. This technique increases the importance of the page with search engines, as each page is its own standalone page rather than a CGI argument. This type of template system also makes it simple to track page views through regular website statistics software.

On the other hand, this type of template system still has the weakness of having one title and one set of meta-tags for the entire site. This is, again, because the header portion of templates has to include everything from the opening of the tag to the end of the code for the header portion of the template. And this area includes the title and meta-tags. One workaround for this type of system is to code the top template page to check which file it is being called from, and to substitute a suitable pre-coded title. Although effective, such a system is cumbersome to maintain as each new page that is published warrants a new title and meta-tag entry in this secondary system.

Body-Only Includes

The ideal PHP templating system will permit content producers to enjoy the reusability of templates, while maintaining unique titles and metadata for each page with ease. The system that meets all of these SEO needs is a "body-only include" system: a system where each php content page includes the top and bottom portions of the template (as in the previous approach), but only includes the elements below the body tag. This translates into a document that has its own html, head, title and meta tags, has an include_once() statement which is called at the top of the body element and includes the top portion of the template, has the content, and an include for the footer portion of the template. Such a system allows for individual editing of the title and meta-information during the creation of documents and solves the problems that both of the aforementioned systems face.

I find this system the most search-engine friendly, because it keeps the title information and the content together - allowing for the presence of relevant, unique titles for each page. This system is also the most human friendly, as storing the title information in the same file as the page content allows for fast updating and avoids maintaining a second "workaround" system that attempts to match titles to content.

Conclusion

The types of template system that PHP developers choose to implement for clients' sites have a crucial impact on the future search-engine popularity of the client's webpages. Important factors to consider when developing a template solution are: relevant titles tied to content, relevant meta-tags, standalone files and ease of statistics tracking. The popular approaches of page-as-an-argument and template-as-an-include do not effectively provide these functions. Including template information after the body tag, and keeping headers intact is the best way to ensure that sites are optimized for search engines - and this is why you should consider using the Body-Only Includes model during your next project.

Jacob Filipp is a Canadian search engine optimization specialist at [http://powerspiritonline.com/contact.html]Powerspirit. Jacob has 7 years of experience as a web developer and webmaster.

Article Source: http://EzineArticles.com/?expert=Jacob_Filipp http://EzineArticles.com/?Choose-Wisely:-PHP-Templates-and-Search-Engine-Rank&id=597857

Saturday, October 27, 2007

PHP Developers

SQL Server ASP Websites - First Steps for Novice Developers
By [http://ezinearticles.com/?expert=Margaret_Cruise_O'Brien]Margaret Cruise O'Brien

Database-Driven Websites

Ten years ago, novice web developers worked hard to create static websites with HTML and perhaps a bit of Javascript to spice up the action. Now, novice developers are starting with database-driven web pages that let web site visitors enter data and view dynamic content. When you're learning, it's important to start small and work your way up to large complex sites. So where should the novice developer start?

Your First Web Database Application

To keep motivated, you should choose a small project that will actually be useful. A great candidate is the opt-in page: a web page that lets visitors provide their name and email address to be saved to the website database. Presumably the website owner will use this data to send out newsletters and email marketing, but we won't worry about that! This is the perfect training application: a simple but useful one-page database application.

Choosing Your Tools - the Microsoft option

Once you've decided what you're going to develop, you need to decide which tools to develop with. If you're on a budget (and who isn't), then Microsoft has released a development environment available for free. You can download and install Visual Web Developer Express from the Microsoft website, which also comes with a free version of the popular database engine Microsoft SQL Server. The free database is branded as SQL Server Express.

There are other free alternatives open to you - MySQL and PHP has traditionally been a popular choice. If you come from a Linux or Unix background, you'll probably want to go that route, but if you are used to working on Windows machines, then the Microsoft option is appealing.

Creating the Table

For the simple opt-in application, you need a database table that will store names and their email addresses - this is about as simple as it gets. Visual Web Developer Express provides a GUI to let you create tables. For this project, you'll be creating a three-column table. Of course, you need one column to store the visitor's name, and another to store the email address. So why the third?

For proper database design, you should also have a unique ID column within the table that is defined as a primary key and set as an identity field. If this terminology is alien to you, you'll need to read some tutorials on SQL and creating tables. You will find lots of online articles, including [http://www.salmontraining.com/sqlexpresszone/index.html]step-by-step walk-throughs on the process. The work you put into learning basic table creation at this stage will be invaluable for future web projects!

Creating the Web Page

The opt-in web page needs to provide two input boxes to allow the visitor to enter a name and email address. If you've already done a bit of HTML coding, that's no problem to you. The tricky bit is connecting the page to the database and ensuring that the details are written to the table.

This is where Visual Web Developer Express comes into its own. With alternative programming languages, this would take lines of code to put together (and hours of debugging when it doesn't work!). With VWD Express, you use the GUI interface and wizards to drag-and-drop ASP.Net controls to access the database - the tool creates the code you need behind the scenes.

Finding a Hosting Provider

In order to go live, your hosting provider must support ASP.Net and SQL Server. Shop around - there are a number of competing providers out there. If you're working on a budget, then you'll find Go Daddy hard to beat.

Going Live

Getting things working on your laptop or PC is a great achievement! But putting your database application live is real success.

If what's been described up to now sounds too easy - well, the development process is relatively simple with the Microsoft ASP.Net development environment. The Microsoft tools hide much of the complexity of database development.

Unfortunately, developers can hit a roadblock when they try to put their new web application live on a hosted site. Getting the web page to connect to the live database is the first hurdle as the hosting provider will most likely be using SQL Server Enterprise, the big brother of the database on the local laptop or PC. Hosting providers may insist that developers use their own Control Panel to work with the database and create the database table.

Persevere! A bit of time and effort spent going live is worth the feeling of achievement when your first website visitor enters details into the web page and the data flows successfully to the live database!

Margaret Cruise O'Brien is a database consultant, and founder of [http://www.salmontraining.com]Salmon Training Check out our website for training on [http://www.salmontraining.com/sqlexpresszone/going_live_with_vwd_and_sqlexpress.aspx]going live on Go Daddy with a simple ASP.Net SQL Server application

Article Source: http://EzineArticles.com/?expert=Margaret_Cruise_O'Brien http://EzineArticles.com/?SQL-Server-ASP-Websites---First-Steps-for-Novice-Developers&id=684430

Wednesday, October 24, 2007

PHP Developers

Introduction to PHP
By [http://ezinearticles.com/?expert=Gagandeep_Singh_Tathgar]Gagandeep Singh Tathgar

What is PHP?

PHP stands for "PHP: HyperText Preprocessor". PHP is a server side scripting language for making dynamically driven websites. PHP written scripts can be used to keep track of your visitor’s activities on your site, send out emails to your subscribers, let your users upload files or images to your site, and drive the content on your site dynamically using databases. The possibilities are endless. Most of the social networking websites you visit are writing in PHP. Yep! PHP is that powerful.

What are PHP benefits?

PHP is a free open source language. That means you don't have to pay thousands of dollars in licensing fee to acquire PHP. Best of all, it is easy to install. The most striking feature of it is that it is easy to learn. PHP is used by millions of people and developers around the world. There are thousands of websites on the internet which are written using PHP. One primary example is Yahoo! Bookmarks.

What PHP can do for me?
PHP can greatly enhance the functionality of your website. It allows you to write scripts which let your visitors interact with you through your website. If you run a small business website, you can use PHP to let your users send you feed back to you on your products ad services or create a form which will allow your customers to send you emails, etc, etc.

Is PHP easy to learn?

Thou PHP will allow you to almost do anything complicated on your website. But you can implement simple forms or logic on your site very easily. At [http://php-learn-it.com]PHP-Learn-It.com, i explain some of those techniques with examples.

Article Source: http://EzineArticles.com/?expert=Gagandeep_Singh_Tathgar http://EzineArticles.com/?Introduction-to-PHP&id=556967

Monday, October 22, 2007

Illusion Technologies: PHP Developers

Easy Website Builder For Beginners And Pro Web Developers
By [http://ezinearticles.com/?expert=Bruce_Manaka]Bruce Manaka

Have you ever wanted to build a website for personal or business use without the constraints of website templates or the hassle of learning HTML, PHP, web development software, and the necessary learning curve involved? Have you ever been asked by potential clients or customers whether or not you have a website where they can find out more about you and the services you provide?

Nowadays if you do not have a website, you stand the chance of losing out on a lot of business, and potential customers may not look upon you as being "professional." Likewise, for the individual who does not have a business per se, he or she stands the chance of amassing a vastly wider network of contacts through a personal website than the person who relies only on person-to-person network organizations.

Every business needs a website! It's still surprising to see so many businesses that do not have a web presence. This is mainly due to a combination of economic and time factors. It may cost anywhere between $500 to $1500+ to hire a web designer to build a business site containing 1-10 pages of content. To build a site on your own requires time and some knowledge of web development skills. Seen in this light, it's understandable that business owners procrastinate in this very important aspect of their business.

However, building a website has finally reached the 21st Century as far as ease of use and availability to the masses. An easy website builder tool is being released to the world allowing unprecedented ability for just about anyone to build their own website for personal and business use. Whether it's the beginner who wants a one page website or the web developer putting together a hundred page business site, technology just took a huge jump with the advent of Site Rubix, the brainchild of Kyle and Carson of Wealthy Affiliate.

There is absolutely no HTML coding skills needed. Images, video, screen capture and content can be added quickly and easily. With simple click and drag features, websites can be designed the way you want it to look. There is also no need to go through the learning curve required to use Dreamweaver, Frontpage and other web development software.

Site Rubix is an easy website builder that has leveled the playing field in terms of online presence. With this latest in web technology, there is no reason whatsoever to go without a website for yourself and your business!

Would you like to know more about the most recommended website builder? Find out at http://recommendedinternetmarketingresource.blogspot.com/

Article Source: http://EzineArticles.com/?expert=Bruce_Manaka http://EzineArticles.com/?Easy-Website-Builder-For-Beginners-And-Pro-Web-Developers&id=765308

Saturday, October 20, 2007

Illusion Technologies: PHP Developers

Wrtiting Less PHP Code With More Results
By [http://ezinearticles.com/?expert=Bobby_Handzhiev]Bobby Handzhiev

Most web development companies use their own or third party frameworks to improve their development process. If you want to work as a PHP developer in a company you will most probably need to agree to write your code using their framework. This article is for these developers and companies who want to build their own framework and improve their coding speed, the quality of their code and get paid more for less time. I will share with you the ideas we discovered in PIM Team Bulgaria while working on our PHP framework, but not the framework itself - you need to develope your own one which to suit the most your coding style. Our advises are valid for almost any other programming language.

What is a framework and why I need it?

Don't you get bored when you need to write same or similar types of code again and again? Do you hate when customer wants to change "some unsignificant thing" but you need to change it in 10 different files? Are your scripts too long? Do you write "spagetti" code? If you answer "yes" on some of these questions, then you need a set of functions and classes which will automate most of the tasks, reduce your code size and avoid copy-paste practices. That is framework. It is a set of classes and functions which you just include in your scripts and make your life of a web developer easier.

What to "put" in a framework?

Some people and companies tend to believe that everything should be generated by functions and classes and you should never have a "free flying" PHP code. As a result of that they put everything in objects and extremly complicated functions which try to handle everything for everyone. As a result the code gets hard to read, buggy, hard to change and slow to write and learn.

Other group prefers to write everything for the current situation, again and again for every project and file. They often copy-paste hundreds of rows to save development time and effort, but when they have to modify the code it turns into a pain. And all of this is because they are too lazy to create a framework.

The solution as usually is somewhere in the middle. You should be looking to optimize tasks which are repeated often in the project or in different projetcs. Here are the best propositions:

- Mail functions - it's terrible to see most developers putting all the headers in each place where they need to send a mail. Just wrap the mail() function and use the wrapper.

- Database wrappers - you MUST have one. Stop using the built in mysql (or other DB) functions directly into your projects. What will happen if the database must be changed?

- Database functions - do you really need to type manually all the 50 field names of that table and then to manually fill the values from $_POST? Sure, it is often needed when the values come in a different way. But very often, especially in admin panels you just have a form with fields corresponding to the table ones and values in them. Just iterate thru the database fields (hint: "SHOW FIELDS FROM table_name") and insert/update

- HTML code snippets - aren't you tired of creating or copy-pasting date dropdowns, checkboxes, normal dropdowns or radio groups? Create functions for each of these - it could accept parametters as name, values, selected name...

- Formatting specifics such as date, money, phone numbers etc. Yes, the PHP functions like date() allow you to format in any way. But what happens if you have dates on hundred places and the customers decide that instead of mm/dd/yy they want format "dd Month, YYYY"? Don't change it everywhere, don't use the MySQL data formatting. Create your own wrapper and use it.

- Admin panels - each and every admin panel includes screens for add/edit/delete various table contents. Why to do it each time? In PIM Team we created a class called table_editor which simply receives several massives and arguments and handles all the operations on any complex DB table, including the HTML code for the editing webform in less than 20 lines! The admin pages don't need to look nice, but yet our table_editor allows your tables to look perfect with CSS

- File and picture uploading, resizing, thumbnails. You don't really write every time all the codes in your scripts I hope. It would be crazy. You need functions or class for these

- Project sopecific functions. Many websites have specific features like displaying category trees, specific dropdowns, small tables with user's profiles etc etc. You can and must put these in objects or functions and use across your porjects.

Don't overdo your framework

You can't handle everything for every case. Maybe you can but this will make your framework heavy, slow to process and hard to use. The goal of the framework is to make your life easier, not some idealistic idea for pure OOP coding. You need to export functions and objects of things which you do often within different projects or several times in one project. You will only loose time if you try to handle some individual cases.

Bobby Handzhiev is a Senior Developer in http://pimteam.net and editor of http://knowledgebase.pimteam.net

Article Source: http://EzineArticles.com/?expert=Bobby_Handzhiev http://EzineArticles.com/?Wrtiting-Less-PHP-Code-With-More-Results&id=150773

Template Design | Elque 2007