Sunday, January 4, 2009

How to Do Everything with PHP and MySQL (How to Do Everything)













How to Do Everything with PHP and MySQL (How to Do Everything)

This new release in the popular How to Do Everything series explains how to build open source web applications with MySQL and PHP 5. Using these two tools, you’ll be able to create highly functional, interactive web sites easily. Follow along with a step-by-step sample application and, as a bonus, download three full-length case studies complete with code trees

Learning PHP & MySQL: Step-by-Step Guide to Creating Database-Driven Web Sites













Learning PHP & MySQL: Step-by-Step Guide to Creating Database-Driven Web Sites

PHP and MySQL are quickly becoming the de facto standard for rapid development of dynamic, database-driven web sites. This book is perfect for newcomers to programming as well as hobbyists who are intimidated by harder-to-follow books. With concepts explained in plain English, the new edition starts with the basics of the PHP language, and explains how to work with MySQL, the popular open source database. You then learn how to put the two together to generate dynamic content.

If you come from a web design or graphics design background and know your way around HTML, Learning PHP & MySQL is the book you've been looking for. The content includes:
  • PHP basics such as strings and arrays, and pattern matching
  • A detailed discussion of the variances in different PHP versions
  • MySQL data fundamentals like tables and statements
  • Information on SQL data access for language
  • A new chapter on XHTML
  • Error handling, security, HTTP authentication, and more
Learning PHP & MySQL explains everything from fundamental concepts to the nuts and bolts of performing specific tasks. As part of O'Reilly's bestselling Learning series, the book is an easy-to-use resource designed specifically for beginners. It's a launching pad for future learning, providing you with a solid foundation for more advanced development.







Learning PHP 5













Learning PHP 5

Learning PHP 5 is the ideal tutorial for graphic designers, bloggers, and other web crafters who want a thorough but non-intimidating way to understand the code that makes web sites dynamic. The book begins with an introduction to PHP, then moves to more advanced features: language basics, arrays and functions, web forms, connecting to databases, and much more. Complete with exercises to make sure the lessons stick, this book offers the ideal classroom learning experience whether you're in a classroom or on your own.

Learning PHP and MySQL













Learning PHP and MySQL

The PHP scripting language and MySQL open source database are quite effective independently, but together they make a simply unbeatable team. When working hand-in-hand, they serve as the standard for the rapid development of dynamic, database-driven websites. This combination is so popular, in fact, that it's attracting many programming newbies who come from a web or graphic design background and whose first language is HTML. If you fall into this ever-expanding category, then this book is for you.

Learning PHP and MySQL starts with the very basics of the PHP language, including strings and arrays, pattern matching and a detailed discussion of the variances in different PHP versions. Next, it explains how to work with MySQL, covering information on SQL data access for language and data fundamentals like tables and statements. Finally, after it's sure that you've mastered these separate concepts, the book shows you how to put them together to generate dynamic content. In the process, you'll also learn about error handling, security, HTTP authentication, and more.

If you're a hobbyist who is intimidated by thick, complex computer books, then this guide definitely belongs on your shelf. Learning PHP and MySQL explains everything--from basic concepts to the nuts and bolts of performing specific tasks--in plain English.

Part of O'Reilly's bestselling "Learning" series, the book is an easy-to-use resource designed specifically for newcomers. It's also a launching pad for future learning, providing you with a solid foundation for more advanced development.

Learning PHP Data Objects













Learning PHP Data Objects

This book is for PHP developers who need to use PHP Data Objects (PDO) for data abstraction. Covering an overview of PDO, getting started, error handling, prepared statements, handling rowsets, advanced uses, and use in an MVC application, it first describes the topic, then gives step-by-step instructions for a particular example. A final appendix covers the object-oriented features of PHP 5. Readers should be familiar with PHP and aware of the basics of data abstraction. Lighter, faster, more powerful than existing data abstraction interfaces, PDO is an open-source query abstraction layer for accessing databases and manipulating returned records that is used with a database-specific PDO driver to access a particular database. It has the same role as classic database abstraction layers such as ODBC and JDBC. PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in the core of PHP 5, and so will not run with earlier versions of PHP.






Mastering PHP 4.1











Mastering PHP 4.1

Extending and Embedding PHP













Extending and Embedding PHP

In just a few years PHP has rapidly evolved from a small niche language to a powerful web development tool. Now in use on over 14 million Web sites, PHP is more stable and extensible than ever. However, there is no documentation on how to extend PHP; developers seeking to build PHP extensions and increase the performance and functionality of their PHP applications are left to word of mouth and muddling through PHP internals without systematic, helpful guidance. Although the basics of extension writing are fairly easy to grasp, the more advanced features have a tougher learning curve that can be very difficult to overcome. This is common at any moderate to high-traffic site, forcing the company hire talented, and high-priced, developers to increase performance. With Extending and Embedding PHP, Sara Golemon makes writing extensions within the grasp of every PHP developer, while guiding the reader through the tricky internals of PHP.







Foundation PHP 5 for Flash (Foundation)













Foundation PHP 5 for Flash (Foundation)

David Powers has been professionally involved with the electronic media for some 30 years, mostly in radio and television—he was BBC Tokyo correspondent in the late 1980s and early 1990s—but more recently with the Internet. He built his first site in 1995, and was instantly hooked. Eventually, the sheer tedium of updating content convinced him there must be a better way. After a brief flirtation with ASP, he experimented with PHP, and found himself hooked yet again.

A fluent Japanese speaker, Powers specializes in building Japanese-English bilingual websites, writing about Japan, and translating Japanese (he’s translated several plays). He co-authored Foundation Dreamweaver MX 2004 (1590593081) and PHP Web Development with Dreamweaver MX 2004 (1590593502). Powers also worked as technical reviewer on a number of web-related titles for Apress.









Foundation PHP for Dreamweaver 8













Foundation PHP for Dreamweaver 8

In this book, youll learn how to:
  • Install, configure, and troubleshoot a testing environment with PHP/MySQL and Apache or IIS
  • Learn the fundamentals of PHP and good database design
  • Use Dreamweaver 8 server behaviors to create robust dynamic applications that validate user input for greater security and reliability
  • Incorporate live XML feeds into your web pages with PHP and Dreamweaver 8s new XSL Transformation server behavior
  • Download and apply a suite of custom-built PHP functions designed exclusively for this book
Want to add the power of a database to your websites? Build online forms that send feedback straight to your inbox? Incorporate live news feeds and XML data into your web pages? This book shows you how to do all that and more. Dreamweaver 8 takes a lot of the hard work out of integrating a database into your websites, but it cant do everything. So instead of just giving you a series of instructions to click this and click that, this book helps you understand whats going on in the background. As a result, youre more likely to remember and to get it right. Most books on PHP concentrate on code and throw all design considerations out the window. This one is different. It makes use of Dreamweaver 8s vastly improved CSS rendering, and shows you how to build a site thats smart in both senses of the word. It looks good and is intelligent too. Youll learn how to change the entire look of the site, using PHP to serve up different stylesheets each month. Youll also build a contact form protected against email injection attacks. All of Dreamweavers PHP server behaviors are put through their paces, and youll even make some custom server behaviors that will come in useful on any site you create. Two chapters take you through the setup process with step-by-step instructions for both Windows and Mac OS X, helping you make the right choices: Apache or IIS? Remote or local testing? There are even instructions on how to set up virtual hosts on your own computer. And in the unlikely event that things go wrong, theres plenty of troubleshooting advice too. In this book we look specifically at using Dreamweaver's built-in server behaviors to build dynamic web sites using PHP and MySQL, the worlds most popular open source server-side language and database server combination, which are both reliable, powerful, and open source (and therefore free to use!) This latest version of Dreamweaver includes more powerful support for PHP and MySQL than ever before, and we'll show you how to make this work for you. No previous experience of PHP or MySQL is necessary to use this book. Examples built throughout the book include a content management system, and an online image gallery. All examples are designed to meet modern usability requirements and be web standards compliant. Summary of Contents:

  • Introduction
  • Chapter 1: So, You Want to Build Dynamic Sites?
  • Chapter 2: Dreamweaver and PHPA Productive Partnership
  • Chapter 3: Getting the Work Environment Ready
  • Chapter 4: Getting Ready for the Case Study
  • Chapter 5: Integrating PHP into Your Site
  • Chapter 6: Getting Feedback from an Online Form
  • Chapter 7: Putting the Power of a Database
  • Chapter 8: Building a Random Quotation Generator
  • Chapter 9: Working with Multiple Tables
  • Chapter 10: Using Sessions to Track
  • Chapter 11: Displaying a Blog and Photo Gallery
  • Chapter 12: Using XSLT to Display Live News Feeds and XML
  • Appendix A: Using Languages Other Than English in MySQL
  • Appendix B: Essential MySQL Maintenance
  • Index








Foundation PHP for Flash













Foundation PHP for Flash

Written for the Flash developer who wants to do more, Steve Webster's PHP for Flash shows how to combine simple server-side scripts with Flash to create smarter, more versatile Web applications. With a truly engaging writing style and a sharp visual sense, this title will let any working Flash programmer make the transition to simple server-side scripting with PHP.

While most programming books print source code as is, this one distinguishes itself with a keen visual presentation with graphics used to highlight sections of both Flash ActionScript and basic PHP. It also helps that Webster is a notably lively writer. A few guiding principles govern this text. First, all the interfaces are created in Flash and ActionScript, and the book walks you through the steps required to build these designs.

After a basic tutorial of the PHP language, the author uses PHP to add additional functionality to Flash-powered Web applications, from managing user registration to searching news articles using regular expressions. This text provides one of the best (and most truly accessible) tutorials for understanding and using regular expressions. While most writers pass the buck to difficult online resources for regular expressions, the author takes the time to explain and demonstrate how regular expressions really work, with clear examples and a nicely patient presentation style.

Later, the book zeros in on using the MySQL database package for storing and retrieving data from Flash applications. To this end, there's a quick introduction to programming with SQL and how to query and update data using PHP combined with MySQL. Later chapters present case studies of larger Flash applications that make use of techniques demonstrated earlier, like a customizable user poll, a simple event scheduler, plus a threaded discussion forum. With a winning writing style and a concise presentation that makes smart use of graphics, PHP for Flash will put simple PHP programming within reach of anyone who has a little previous familiarity with Flash. --Richard Dragan

Topics covered: Overview of PHP 4 and scripting essentials, loading external data in Flash (a registration script), PHP language fundamentals (including variables, data types, arrays), using functions (calling conventions), string handling in PHP, in-depth tutorial on PHP regular expressions, using cookies, file I/O tutorial, introduction to the MySQL database platform, basic SQL syntax tutorial, using PHP and MySQL together (a simple content management system), case study for a user poll (including administration modules), event planner scheduler application, case study for a threaded discussion Web application, reference for installing PHP and MySQL, object-oriented programming essentials in PHP, and resources for PHP.









Foundations of PEAR: Rapid PHP Development (Foundations)













Foundations of PEAR: Rapid PHP Development (Foundations)

PEAR, the PHP Extension and Application Repository, is a bountiful resource for any PHP developer. Within its confines lie the tools that you need to do your job more quickly and efficiently. You need to be able to quickly assess and determine which PEAR package is the right one for the task you are up against. Then you need to know the API and see some examples of how to best use it. Foundations of PEAR is your one stop for locating the PEAR package you need. Authors Nathan Good and Allan Kent have carefully selected the most useful and widely used packages for this book.

Each package is broken down logically by function, and each one is covered in detail. The book presents each package in a manner that allows you to jump quickly to the key items you need to implement a solution. The authors understand that you need to see the packages in actioneach performing in real-world applications. So theyve included four projects in the book that each use a combination of PEAR packages in their implementations. Once youre armed with the knowledge in this book, youll be set to take your PHP development to a new level.









Core PHP Programming, Third Edition













Core PHP Programming, Third Edition

Core PHP Programming, Third Edition is the authoritative guide to the new PHP 5 for experienced developers. Top PHP developer Leon Atkinson and PHP 5 contributor/Zend Engine 2 co-creator Zeev Suraski cover every facet of real-world PHP 5 development, from basic syntax to advanced object--oriented development-even design patterns!

It's all here: networking, data structures, regular expressions, math, configuration, graphics, MySQL/PostgreSQL support, XML, algorithms, debugging, optimization...and 650 downloadable code examples, with a Foreword by PHP 5 contributor and Zend Engine 2 co-creator Andi Gutmans!







Core Web Application Development with PHP and MySQL













Core Web Application Development with PHP and MySQL

The programmers guide to building robust web applications with PHP and MySQL

This is a comprehensive, practical guide for programmers who want to develop production-quality, database-enabled web applications with PHP and MySQL. Long-time developer Marc Wandschneider systematically addresses the entire process: not only coding, but also upfront application, user interface and database design, PLUS security, testing, and more. Youll walk through building three applications from start to finish: a calendaring system, a weblog engine, and an e-commerce store. Along the way, youll master essential strategies for creating robust web database applications and learn how to avoid the common pitfalls that trip up many developers moving to PHP and MySQL.

Starts with a complete primer on PHP for developersincluding Contains detailed treatments of data access, including Presents powerful data validation techniques utilizing PHP regular Walks through planning web applications, including user interfaces Offers systematic guidance on securing web applications from end Covers a wide range of implementation issuesincluding internationalization, error handling, data validation, debugging, Includes detailed chapters on XML, XML-based web services, and the Shows how to work with the Oracle and PostgreSQL databases







Creating Database Web Applications with PHP and ASP (Internet Series)













Creating Database Web Applications with PHP and ASP (Internet Series)


If you want to add more power and functionality to your Web sites, add some database applications like a powerful shopping cart or a fun quiz game. Such applications make your site more dynamic, allow you to gather information, and provide customized experiences for your visitors. Creating Database Web Applications with PHP and ASP teaches beginning and intermediate designers the fundamentals of creating complex Web applications. By covering both open source (PHP/MySQL) and proprietary tools (Microsoft ASP and Access), readers gain insight to the strengths and weaknesses of each. In addition, they learn how to work with both sets of tools and determine which works best for their projects. Practical examples, including a shopping cart and quiz show, are used to teach the basic concepts behind creating and testing database code. Every example is also provided in both PHP and ASP for easy comparison and use. With the knowledge and experience gained here, beginners will learn the fundamental concepts behind these two technologies, while more experienced developers will learn which technology works best for their specific needs. Exercises, questions, and projects are included with each chapter.







Creating Interactive Web Sites with PHP and Web Services












Creating Interactive Web Sites with PHP and Web Services

Build Dynamic Websites with PHP and MySQL—and Extend Those Sites with Web Services

PHP and MySQL are great tools for building database-driven websites. There's nothing new about that. What is new is the environment in which your site operates—a world rich (and growing richer) in web services that can add value and functionality in many different ways. Creating Interactive Web Sites with PHP and Web Services walks you through every step of a major web project—a content-management system—teaching you both the basic techniques and little-known tricks you need to build successful web sites. And you can use those skills to develop dynamic applications that will meet your special requirements. Here's some of what you'll find covered inside:

  • Adding, deleting, and displaying data with a custom content-management system
  • Building a template system with PHP
  • Interacting with web services using PHP and MySQL
  • Creating and managing a user system and a shopping cart
  • Processing credit card payments using merchant accounts and third-party payment solutions
  • Tracking site statistics using PHP and MySQL
  • Enhancing your site with third-party scripts

Tons of examples, complete with explanations and supported by online source code, will speed your progress, whether you're a true beginner or already have PHP experience. This book is platform-agnostic, so it doesn't matter if you're deploying your site on Linux or Windows. You also get PHP and MySQL references, so you can quickly resolve questions about syntax and similar issues.









Essential PHP Security













Essential PHP Security


Being highly flexible in building dynamic, database-driven web applications makes the PHP programming language one of the most popular web development tools in use today.

It also works beautifully with other open source tools, such as the MySQL database and the Apache web server. However, as more web sites are developed in PHP, they become targets for malicious attackers, and developers need to prepare for the attacks. Security is an issue that demands attention, given the growing frequency of attacks on web sites.

Essential PHP Security explains the most common types of attacks and how to write code that isn't susceptible to them. By examining specific attacks and the techniques used to protect against them, you will have a deeper understanding and appreciation of the safeguards you are about to learn in this book. In the much-needed (and highly-requested) Essential PHP Security, each chapter covers an aspect of a web application (such as form processing, database programming, session management, and authentication).

Chapters describe potential attacks with examples and then explain techniques to help you prevent those attacks. Topics covered include: Preventing cross-site scripting (XSS) vulnerabilities Protecting against SQL injection attacks Complicating session hijacking attempts You are in good hands with author Chris Shiflett, an internationally-recognized expert in the field of PHP security. Shiflett is also the founder and President of Brain Bulb, a PHP consultancy that offers a variety of services to clients around the world.







Friday, January 2, 2009

Beginning PHP5













Beginning PHP5

What is this book about?

Beginning PHP5 is a complete tutorial in PHP5's language features and functionality, beginning with the basics and building up to the design and construction of complex data-driven Web sites. Fully functioning applications are developed through the course of the book. Other features of the book include installation guide and troubleshooting tips, introduction to relational databases, practical working examples and applications, and a detailed language reference.

Here are the new topics in this edition:

  • OOP
  • PEAR
  • GTK
  • MSI
  • CLI
  • SQLite
  • Error handling with try/catch








CakePHP Application Development













CakePHP Application Development








CodeIgniter for Rapid PHP Application Development













CodeIgniter for Rapid PHP Application Development

CodeIgniter (CI) is a powerful open-source PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications. CodeIgniter is an MVC framework, similar in some ways to the Rails framework for Ruby, and is designed to enable, not overwhelm.

This book explains how to work with CodeIgniter in a clear logical way. It is not a detailed guide to the syntax of CodeIgniter, but makes an ideal complement to the existing online CodeIgniter user guide, helping you grasp the bigger picture and bringing together many ideas to get your application development started as smoothly as possible.

  • Clear, structured tutorial on working with CodeIgniter
  • Careful explanation of the basic concepts of CodeIgniter and its MVC architecture
  • Using CodeIgniter with databases, HTML forms, files, images, sessions, and email
  • Building a dynamic website quickly and easily using CodeIgniter's prepared code

Improve your PHP coding productivity with this guide to the powerful and popular CodeIgniter framework.

  • Setting up the CI package on your web server
  • Understanding the Model-View-Controller (MVC) pattern for organizing a dynamic website
  • Understanding the structure of a CI site
  • Designing better views and controllers
  • Object-oriented aspects of CI
  • Integrating databases such as MySQL and simplifying your database access
  • Making your site more robust and professional by using CI's built-in classes
  • Creating and validating HTML forms with CI form helpers
  • Handling files, images, and sessions with CI
  • Sending email from CI
  • Using CI for testing your code with error handling, unit testing, benchmarking, and profiling
  • Getting an XML-RPC server and client working
  • Generating Create, Update, Delete, and Read (C.R.U.D) entries on each database table

This book steps you through the main features of CodeIgniter in a systematic way, explaining them clearly with illustrative code examples.








Beginning PHP and PostgreSQL 8: From Novice to Professional (Beginning: From Novice to Professional)













Beginning PHP and PostgreSQL 8: From Novice to Professional (Beginning: From Novice to Professional)


Beginning PHP and PostgreSQL 8 delves into some of the most popular open source web development technologies, the PostgreSQL 8 database server and PHP 5 scripting language. You'll learn to reap the benefits of these core technologies by using them in unison to create dynamic, data-driven web applications. This is an ideal read if you are a web designer, programmer, hobbyist, or novice who wants to create applications with PHP 5 and PostgreSQL 8.







Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional (Beginning, from Novice to Professional)














Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional (Beginning, from Novice to Professional)

The PHP language and PostgreSQL database server have long offered an ideal blend of practicality and power for both the novice and experienced programmer alike. Yet the continued evolution of both technologies makes them better suited to drive enterprise-class applications than ever before. In Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional, noted authors Cristian Darie, Emilian Balanescu, and Mihai Bucica show you how to take advantage of this powerful duo to build an e-commerce web site, guiding you step-by-step through the process of designing and developing the project.

Each chapter is devoted to a specific new feature. You'll learn how to build an online product catalog complete with pagination features, shopping cart, checkout mechanism, product search feature, product recommendations, administrative features, customer accounts, an order-management system, and more. You'll also learn how to process electronic payments by integrating several popular payment services, including PayPal, DataCash, and Authorize.net, and how to integrate the Amazon E-Commerce Service (ECS).

The book promotes good programming practices, including the separation of presentation code, business code, and data access code using a 3-tier architecture. PDO (PHP Data Objects) is used to connect to the database, and PostgreSQL functions are used to store the data logic. The Smarty templating engine is used to create the presentation layer. For a preview of what this book will teach you, take a look at the HatShop shopping cart demo.

Who This Book Is For

Beginning PHP and PostgreSQL E-Commerce: From Novice to Professional is aimed at developers looking for a tutorial approach to building a full e-commerce web site from design to deployment. However, its assumed that you have mastered the basics of PHP and have some experience working with relational databases (preferably PostgreSQL).









Debugging techniques for PHP programmers by Tyler Anderson

Introduction

There are many PHP debugging techniques that can save you countless hours when coding. An effective but basic debugging technique is to simply turn on error reporting. Another slightly more advanced technique involves using print statements, which can help pinpoint more elusive bugs by displaying what is actually going onto the screen. PHPEclipse is a Eclipse plug-in that can highlight common syntax errors and can be used in conjunction with a debugger to set breakpoints.

Setting up

To learn the concepts described in this article, you are going to need PHP, a Web server, and Eclipse. The latest version of PHP supported by the debugger extension is V5.0.3.

We need a Web server to parse the pages you create in PHP and display them to the browser. This article uses Apache2. However, any Web server will suffice.

To take advantage of some of the debugging techniques in this article, you need to install Eclipse V3.1.1 and the plug-in: PHPEclipse V1.1.8. Since Eclipse requires Java™ technology, you also need to download that.

You also need the debugger module extension for PHP. Installing it is a bit tricky. Carefully follow the instructions for installing the debugger extension. For now, comment out the lines where you are asked to load and configure the extension in PHP in the php.ini file. We’ll uncomment those lines when we’re ready to use the debugger.

See Resources for download information. Now let's move on to error messages.

Error messages

Error messages are your first line of defense as a developer. You don't want to be developing code in PHP on a server that is not configured to display error messages. However, keep in mind that when your code is debugged and ready to go live, you want to make sure error reporting is turned off because you don't want visitors to your site seeing error messages that may give them enough knowledge to exploit a weakness and hack your site.

You can also use error messages to your advantage because they display the exact line of code that threw or generated an error. This makes debugging a matter of looking at the line number shown on the browser by the generated error and checking that line number in your code. Later, you will see that the PHPEclipse plug-in aides significantly in the development and debugging process by underlining syntax errors on the fly and by marking syntax errors with a red "x" when saving your file.

Let's take a look at how to turn error reporting on in the php.ini file and set the level of error reporting. Then you'll learn how to override these settings in the Apache configuration file.

Error reporting in PHP

There are many configuration settings in the php.ini file. You should already have set up up your php.ini file and placed it in the appropriate directory, as shown in the instructions in the Install PHP and Apache2 on Linux document (see Resources). There are a couple configuration variables you should know about when debugging your PHP applications. Here they are with their default values:


display_errors = Off

error_reporting = E_ALL

You can discover the current default values of these variables by searching for them in the php.ini file. The purpose of the display_errors variable is self-evident -- it tells PHP whether or not to display errors. The default value is Off. To make your life easier in the development process, however, set this value to On by replacing Off:


display_errors = On

The error_reporting variable has a default value of E_ALL. This displays everything from bad coding practices to harmless notices to errors. E_ALL is a little too picky for my liking in the development process because it clutters the browser output by displaying notices on the screen for small things like uninitialized variables. I prefer to see the errors, any bad coding practices, but not the harmless notices. Therefore, replace the default value of error_reporting as follows:


error_reporting = E_ALL & ~E_NOTICE

Restart Apache, and you're all set. Next, you'll learn how to do the same thing on Apache.

Error reporting in the server

Depending on what Apache is doing, turning error reporting on in PHP may not work because you may have multiple PHP versions on your computer. It's sometimes hard to tell which PHP version Apache is pointing to because Apache can only look at one php.ini file. Not knowing which php.ini file Apache is using to configure itself is a security problem. However, there is a way to configure PHP variables in Apache to guarantee the setting of the correct error levels.

Also, it's good to know how to set these configuration variables on the server side to veto or pre-empt the php.ini file, providing a greater level of security.

You should already have toyed with basic configurations in the http.conf file at /conf/httpd.conf when you configured Apache.

To do the same as you just did in the php.ini file, add the following lines to your httpd.conf to override any and all php.ini files:


php_flag  display_errors        on

php_value error_reporting 2039

This overrides the flag you have set for display_errors in the php.ini file, as well as the value of error_reporting. The value 2039 stands for E_ALL & ~E_NOTICE. If you prefer E_ALL, set the value to 2047, instead. Again, make sure you restart Apache.

Next, we'll test error reporting on your server.

Testing error reporting


You will save a great deal of time if you leave error reporting enabled. Errors in PHP point you right to the error in your code. Create a simple PHP file, test.php, and define it as shown in Listing 1.

Listing 1. A simple PHP that generates an error




  1. print("The next line generates an error.
    "
    );

  2. printaline("PLEASE?");

  3. print("This will not be displayed due to the above error.");

  4. ?>



The first print() statement should display its contents to the Web browser. However, the second statement generates and displays an error to the Web page. This results in the last print() statement do nothing

5 Tips To Speed Up PHP Development by Dennis Pallett

Introduction

As PHP developers, we all like to create our PHP scripts as fast as possible, and we try to take any shortcuts that we have. In some sense we are quite lazy, and we hate doing all the grunt work. That's why I'm going to give you five tips to really speed up your PHP development, and save some serious time. If you're an experienced PHP developer, these tips will probably seem very obvious to you, so this article is geared more towards beginners.

Tip #1 - Use a good editor or IDE

Using a good editor can really save you time. If you're still stuck on using Notepad to edit your PHP scripts, switch right now. There are plenty of free alternatives around, such as PHPEdit
or EditPlus 2 (Shareware). The biggest advantage you get with a proper editor is code highlighting (automatically coloring your code). Code highlighting can help you debug your scripts, or follow code logic. Most editors support code highlighting, and if yours doesn't, then you know it's not suited for coding.

Another great advantage of using a good editor is the ability to do powerful search-and-replace operations. I know for a fact that EditPlus 2 supports regular expressions in their search-and-replace functionality, and I bet most editors do. It just makes it so much easier to replace a snippet of code. Imagine having to replace something by hand hundreds of times. Think of the time that gets wasted.

You can also use a full-blown PHP IDE (Integrated evelopment Environment). Unfortunately, there aren't many PHP IDE's, and most of them are quite steep in license fees. The best one on the market is Zend Studio, by Zend
(the company backing PHP). An IDE can really save you time, by making the debugging process easier, and some IDE's (such as Zend Studio) also include IntelliSense, which will help you with function names and such (e.g. you start typing file_get.. IntelliSense shows a dropdown that matches what you were typing. It's brilliant).

In short, use a good PHP editor or IDE, and you'll save a massive amount of time!

Tip #2 - Use a framework or skeleton

Most of your PHP scripts will probably do many of the same tasks, such as database functionality (insert, update, select, delete), and have many of the same functions. You could re-write these functions and tasks every time you start a new project, but that seems a bit pointless. Instead, you could use an existing framework or skeleton, and base your new scripts on that.

You can either use a full-blown PHP framework, like CakePHP
or the Seagull Framework, but you can also use a very simple skeleton that you create yourself. It doesn't have
to be complicated at all, and can even be just one file which contains all the functions you commonly use.

If you've already written part of your new script, you've already saved time, no matter how much or little you've already written. If you use a framework, the structure of your script has also been determined already (largely), which can also save time.

In short, you should try to re-use as much code as you can, and try to create (or download) some short of skeleton or framework to really speed up development.

Tip #3 - Don't re-invent the wheel

Continuing the previous tip, something that really speeds up development is using existing solutions. I'm not talking about a skeleton or framework, but using a full-blown script, and customizing it to your needs.

If you're going to build a CMS for your website, which is actually one of the most common things PHP developers create, then you should first look at existing scripts. There are plenty of great scripts already, and many of them are completely free, often licensed under an open source license, such as the GPL license.

A good example of this is WordPress. Originally, WordPress
is a blogging tool, but it can easily be used as a CMS for your website, and you can even extend it using template hacks, plugins or code modifications. This will save you a significant amount of time, which means you can focus your
time on other tasks.

Of course in some situations, when you have really specific needs, it won't be possibly to use an existing script, but before you start, try and find something that resembles your needs. Have a look on HotScripts and search Google. There's a big chance that it already exists.

Tip #4 - KISS (Keep It Simple Stupid)

During the development of a new script, you will probably run across many problems, and you'll have to think of a good solution. The best way is to keep the solution as simple as possible, and as soon as you notice that your code becomes 'filthy', you should consider re-doing it in another way. By filthy I mean overly complicated, and believe me, I've written plenty of filthy code myself.

You get started on some solution, but along the way, you discover more problems, and instead of taking a step back and looking at what the actual problem is, you furiously
code along. This might seem to save time, but in the long run you will only end up with thorny code, that is hard to understand.

The best way is to make everything as simple as possible. I keep everything as short as possible, and my if-statements and loops are never longer than 10-20 lines. If they become longer, I will first look if I can't do it simpler, and if that's not possible, I break it up in blocks, to make it easier to follow.

In some cases I rewrite a particular block of code 3 or 4 times. This might seem a huge waste of time, but it will save you a huge amount of time in the long run.

So in short, try to keep everything as simple as possible. You should be able to immediately understand what's happening, without having to read a huge API guide or the comments.

Tip #5 - Document your code

Another great way to speed up development is to properly document your code, especially the complicated parts. However, you shouldn't over do it. The style of comments below is ridiculous, and completely pointless:



  1. // Opening connection

  2. $linkid = mysql_connect ('localhost', 'sa', 'pass');

  3. // Selecting database

  4. mysql_select_db('mydb', $linkid);

  5. // Running a query

  6. $query = mysql_query ("SELECT * FROM bla");

  7. // etc...


  8. ?>



As you can see, the comments add no value at all. Just by quickly glancing, you can figure it everything the comments say, so the comments don't serve any purpose at all. Better would be something like this:




  1. // Get our content from database

  2. $linkid = mysql_connect ('localhost', 'sa', 'pass');

  3. mysql_select_db('mydb', $linkid);

  4. $query = mysql_query ("SELECT * FROM bla");

  5. // Below is the code for our search algorithm

  6. // This algorithm first looks for a certain keyword

  7. // and the orders it on relevancy


  8. // ... code for algorithm goes here ...


  9. // Now we must make sure that all the posts

  10. // are filtered through the sensor.

  11. // This sensor checks each post, and looks for bad stuff (tm)


  12. // ... code for sensor check ...


  13. ?>



This is already much better, because we immediately know what the purpose is a of certain code block. From there we can then figure out how the code actually works.

Even this style of commenting isn't perfect, but there isn't a "perfect" style of commenting. Each developer has his or her own style, but make sure that other developers can read your code as well. This is especially important
when you work in a team.

If you properly document your code, you will be able to understand it much easier later on, which means you won't have to spend (much) time on figuring out what the code actually does, and can immediately start writing new code.
Good documentation can really save you a good de

Conclusion

In this article I have shown you five ways to shorten your development time and being able to release faster. I must tell though you that the above tips don't always work, but even if you only use one or two shortcuts, you've already
saved precious time.

If you have any tips yourself, or would like to comment on one of the tips above, feel free to leave your comments below.

al of time.


What is PHP? by David Sklar and Adam Trachtenberg

PHP is a server-side scripting language for creating dynamic Web pages. You create pages with PHP and HTML. When a visitor opens the page, the server processes the PHP commands and then sends the results to the visitor's browser, just as with ASP or ColdFusion. Unlike ASP or ColdFusion, however, PHP is Open Source and cross-platform. PHP runs on Windows NT and many Unix versions, and it can be built as an Apache module and as a binary that can run as a CGI. When built as an Apache module, PHP is especially lightweight and speedy. Without any process creation overhead, it can return results quickly, but it doesn't require the tuning of mod_perl to keep your server's memory image small. In addition to manipulating the content of your pages, PHP can also send HTTP headers. You can set cookies, manage authentication, and redirect users. It offers excellent connectivity to many databases (and ODBC), and integration with various external libraries that let you do everything from generating PDF documents to parsing XML.

PHP goes right into your Web pages, so there's no need for a special development environment or IDE. You start a block of PHP code with or even ) The PHP engine processes everything between those tags.

PHP's language syntax is similar to C's and Perl's. You don't have to declare variables before you use them, and it's easy to create arrays and hashes (associative arrays). PHP even has some rudimentary object-oriented features, providing a helpful way to organize and encapsulate your code.

Although PHP runs fastest embedded in Apache, there are instructions on the PHP Web site for seamless setup with Microsoft IIS and Netscape Enterprise Server. If you don't already have a copy of PHP, you can download it at the official Web site. You'll also find a manual that documents all of PHP's functions and features.

Create Your Own Commands

Because PHP scripts sit inside HTML documents, you don't need a special editor to create pages. You do need to be running on a server that supports PHP, however. If you run your own server, this is easy enough to do. If an ISP serves your pages, contact your ISP's support team and ask that they install PHP for you.

For Unix systems, you'll need basic Unix skills, such as using make and a C compiler, an ANSI C compiler on your system, and a Web server.

For Windows 95/NT, you'll need one of the following servers: Microsoft Personal Web Server, Microsoft Internet Information Server 3 or 4, Apache 1.3.x, or Omni HTTPd 2.0b1.

You can find all the information you need to install and configure PHP on the PHP Web site.

Quick Intro to PHP Development by Alan Grissett

Chances are that if you’ve been around the Internet long enough, you’ve heard of server-side scripting languages such as PERL, ASP and ColdFusion. These are all popular languages that are used to add interactivity to Web sites, but one stands out from the crowd in terms of usability, power, and, yes, price: the PHP scripting language. Initially developed in 1995 by North Carolina programmer Rasmus Lerdorf, PHP has since blossomed into one of the leading open-source, cross-platform scripting languages available. This is due, in large part, to the worldwide community of coders that contributes to its development. Unlike proprietary scripting languages like ASP and ColdFusion, PHP’s source code is freely available for peer review and contributions. This is, of course, the essence of open-source software development, but why is it that PHP in particular has gained such popularity among Web developers when there are other open-source alternatives, such as good old-fashioned PERL CGI scripts? One very strong reason is that PHP, unlike PERL CGI scripts, is scalable and fast. Instead of requiring the server to start a new process in the operating system’s kernel for each new request, which uses both CPU time and memory, PHP can run as a part of the Web server itself, which saves a considerable amount of processing time when dealing with multiple requests. This decreased processing time means that PHP can be used for high-traffic sites that cannot afford to have their performance hampered by relatively slow CGI scripts.

In addition to its scalability and speed, another usability factor that sets PHP apart is its ease of use. The PHP language is considered to be a mix between C and PERL, and it draws from the best features of each parent language, while adding unique features of its own. For example, PHP code can be embedded within standard HTML documents without using additional print statements or calling separate scripts to perform the processing tasks. In practice, this allows for very flexible programming practices. Although a working knowledge of HTML is a prerequisite for PHP development, PHP’s basic functions can be learned quickly and applied to a wide range of common Webmaster-related projects, such as order forms, e-mail responses, and interactive Web pages.

Contributing to the power of the PHP language, is its native support for leading relational database platforms, including MySQL, Oracle and PostgreSQL. Platform-specific functions are built into the language for 12 databases in all. This native support for database platforms is a boon to any site that needs to track user information, store product data, or collect sales information.

Last but not least, because PHP is open-source, it is essentially free to use. Almost all professional Unix-based Web hosts offer PHP as an included option with hosting accounts. Be sure to check with your host to see if it is available to you.

This article is meant to be an introduction to the PHP language and not a tutorial, but have no fear—here are several first-rate sites that have articles that will guide you along in beginning your PHP development projects:

www.php.net
www.onlamp.com/php/
www.phpbuilder.com

Thursday, January 1, 2009

Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition (Beginners / Beginning Guide)













Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition (Beginners / Beginning Guide)


Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition covers every step of the design and building process involved in creating powerful, extendable e–commerce web sites. Based around a real–world example involving a web site selling t–shirts, you’ll learn how to create and manage a product catalog, build and integrate a shopping cart, and process customer accounts and PayPal/credit card transactions.

With the e–commerce framework in place, authors Emilian Balanescu and Cristian Darie show you how to integrate advanced features sure to set your web site apart from the competition. You’ll learn how to expand your catalog using Amazon Web Services, optimize the web site for the search engines, and take advantage of Ajax to build an even more user–friendly shopping cart.

Other highlights:

  • The authors show you how to build a complex, extendable e–commerce web site using sound development practices.
  • This second edition has been updated to take advantage of a more flexible templating system, and new chapters cover Ajax integration and search engine optimization.
  • The text goes beyond basic product and customer management, showing you how to integrate product reviews, process payments using both credit cards and PayPal, and expand your web site catalog using third–party services such as Amazons affiliate program.

What you’ll learn

  • Build an extensible e–commerce web site using sound development techniques.
  • Increase sales through proven techniques such as cross–selling, upselling, and enhancing customer service offerings.
  • Expand your product and service offerings by integrating with reseller programs such as Amazon Affiliates via XML web services.
  • Take advantage of search engine optimization techniques to make your web site more easy to find.

Who is this book for?

This book was written for individuals seeking to build e–commerce web sites using the PHP language and MySQL database.


About the Apress Beginning Series


The Beginning series from Apress is the right choice to get the information you need to land that crucial entry–level job. These books will teach you a standard and important technology from the ground up because they are explicitly designed to take you from “novice to professional.” You’ll start your journey by seeing what you need to know—but without needless theory and filler. You’ll build your skill set by learning how to put together real–world projects step by step. So whether your goal is your next career challenge or a new learning opportunity, the Beginning series from Apress will take you there—it is your trusted guide through unfamiliar territory!


Related Titles

Beginning PHP and MySQL 5: From Novice to Professional, Second Edition

PHP 5 Objects, Patterns, and Practice








Beginning PHP and MySQL: From Novice to Professional, Third Edition (Beginning from Novice to Professional)














Beginning PHP and MySQL: From Novice to Professional, Third Edition (Beginning from Novice to Professional)

Beginning PHP and MySQL: From Novice to Professional, Third Edition offers a comprehensive introduction to two of the most prominent open source technologies on the planet: the PHP scripting language and the MySQL database server. Updated to introduce the features found in MySQLs most significant release to date, readers learn how to take advantage of the latest features of both technologies to build powerful, manageable, and stable web applications.

Essentially three books in one, readers not only profit from extensive introductions to the core features of each technology, but also learn how to effectively integrate the two in order to build robust data-driven applications. Packed with practical examples and insight into the real-world challenges faced by developers based on author W. Jason Gilmore's 7 years of expertise working with these technologies, readers will repeatedly return to this book as both a valuable instructional tool and reference guide.

What youll learn

  • The PHP language
  • How to back your web site with MySQL
  • Templating so that you can apply a consistent design across all pages on your site
  • How to authenticate your web site users
  • How to use cookies to maintain information (such as items in a shopping cart) while a user is browsing your site

Who is this book for?

This book is written for developers seeking to take advantage of the PHP language and MySQL database to create powerful web applications.

About the Apress Beginning Series

The Beginning series from Apress is the right choice to get the information you need to land that crucial entry-level job. These books will teach you a standard and important technology from the ground up because they are explicitly designed to take you from "novice to professional." Youll start your journey by seeing what you need to knowbut without needless theory and filler. Youll build your skill set by learning how to put together real-world projects step by step. So whether your goal is your next career challenge or a new learning opportunity, the Beginning series from Apress will take you thereit is your trusted guide through unfamiliar territory!

Related Titles

  • Beginning PHP 5 and MySQL E-Commerce: From Novice to Professional
  • Beginning Ajax with PHP: From Novice to Professional
  • PHP 5 Recipes: A Problem-Solution Approach
  • Pro PHP Security
  • PHP 5 Objects, Patterns, and Practice

Beginning PHP and Oracle: From Novice to Professional (Expert's Voice)














Beginning PHP and Oracle: From Novice to Professional (Expert's Voice)

Beginning PHP and Oracle: From Novice to Professional offers comprehensive information on using the PHP scripting language in conjunction with Oracle's database platform. PHP is one of the most prominent open source technologies in the area of web development, while Oracle is one of the most widely deployed and used database products.

You'll learn to reap the benefits of these core technologies by using them in unison to create dynamic, data-driven web applications. The book is packed with practical examples based on the many years of real-world experience of authors W Jason Gilmore and Bob Bryla. This book is an ideal read for web designers or programmers wanting to create applications with PHP in an Oracle environment.

  • The book covers a solid alternative to the "M" in the LAMP stack.
  • Database examples are based on real-world scenarios.
  • The text shows off Oracle's strong enterprise features.
  • The authors highlight Oracle's robust internationalization support.
  • Covers a solid alternative to the "M" in the LAMP stack
  • Database examples are based on real-world scenarios
  • Shows off Oracle's strong, enterprise features
  • Highlights Oracle's robust internationalization support







Beginning PHP 5, Apache, and MySQL Web Development














Beginning PHP 5, Apache, and MySQL Web Development
This update to a Wrox bestseller dives in and guides the reader through the entire process of creating dynamic, data-driven sites using the open source "AMP" model: Apache Web server, the MySQL database system, and the PHP scripting language. The team of expert authors covers PHP scripting, database management, security, integration, and e-commerce functions and comes complete with a useful syntax reference.

* Showcases three fully functional Web site examples, with implementations for both Windows and Linux, that readers can incorporate into their own projects
* Updates include a new chapter on PHP5 features and functions, a new example Web site application, and updates to PHP5 throughout the text






Advanced PHP for Web Professionals














Pasword for this file is ==> no pswd
Advanced PHP for Web Professionals
In this concise, hands-on tutorial, PHP expert Christopher Cosentino delivers dozens of powerful new techniques for building serious Web applications. Through professional-quality examples drawn from his six years as a PHP developer, Cosentino walks you through building friendlier, more usable sites; improving user authentication; generating dynamic graphics; parsing XML documents; building database-independent Web applications; and much more!






Advanced PHP Programming













Advanced PHP Programming


Over the past three years PHP has evolved from being a niche language used to add dynamic functionality to small sites to a powerful tool making strong inroads into large-scale, business-critical Web systems. The rapid maturation of PHP has created a skeptical population of users from more traditional ""enterprise"" languages who question the readiness and ability of PHP to scale, as well as a large population of PHP developers without formal computer science backgrounds who have learned through the hands-on experimentation while developing small and midsize applications in PHP. While there are many books on learning PHP and developing small applications with it, there is a serious lack of information on ""scaling"" PHP for large-scale, business-critical systems. Schlossnagle's Advanced PHP Programming fills that void, demonstrating that PHP is ready for enterprise Web applications by showing the reader how to develop PHP-based applications for maximum performance, stability, and extensibility.








Beginning Google Maps Applications with PHP and Ajax: From Novice to Professional













Beginning Google Maps Applications with PHP and Ajax: From Novice to Professional

Google Maps Application Development is the first book to comprehensively introduce Google's popular mapping application programming interface (API). The author team has considerable experience building Google Maps-driven applications, and they cover all aspects of the API. They show you how to create practical, location-based applications that encourage users to interact with the service, add their own information, and dynamically mark up maps.

The book begins with a series of fundamental examples to help you quickly gain familiarity with the API. Then you'll soon be building highly interactive and dynamic mapping applications with the help of the PHP scripting language. You'll learn how to "tag" and interact with maps in order to foster a community-driven experience. And you will discover how to take advantage of third-party geocoding services such as Yahoo geocoding and geocoder.us, as well as use the U.S. Census Bureau's TIGER/Line data to host the service internally.






Chitika

Chitika list ads

Mobile Ads