As Web sites and Web-based applications become more important to commercial firms and other organizations, so too does the methods used for storing data online, such as customer contact information, system login details, product data, and much more. Rewritable flat files may be sufficient for extremely limited data for which security is not an issue. But for most Web sites and applications, a robust database is called for.
There are several relational database management systems (RDBMSs) from which you the developer can choose, ranging from expensive systems that can prove quite difficult to administer, to free and open source alternatives that may not have as many features as the proprietary RDBMSs, but can be much faster to set up and work with. Of these, MySQL is the hands-down favorite.
Read more…
For most dynamic websites you will want to create “Search Engine Friendly” or “User Friendly” URLs, rather than using ugly and meaningless strings or IDs to reference your content. The way you interpret the URLs and use them to get your content is for another article and I won’t go into that right now, what I want to talk about is how to turn your page titles into versions that can be used in your URL.
Read more…
Memcache is a tool which can cache objects in memory – and is often used for speeding up dynamic web applications. PHP has a built-in module for working with memcache, and its a simple and convenient way of introducing caching to your application.
PHP has a PECL module for talking to memcached – look up how to install for your system, but be aware that it isn’t bundled. It’s a good module to include on your system however, quite a few apps will take advantage of it where available.
Read more…
The MVC architectural pattern is a smart and bright way of developing web-based applications. The acronym MVC stands for Model, View and Control: these are the three components that, according to the pattern, every application can (and should) be divided into. I would actually state that MVC is “the ultimate” way of developing apps but since IT is such a fast-growing/evolving discipline, I won’t dare being so bold and just say that it is certainly a topic every good developer should spend some time on.
Read more…
One of the most annoying things about working with images is getting them into the right size. Screenshots start out huge – and you need to resize them to an appropriate size for your website.
Some blogs automatically resize the pictures for you into a thumbnail – like the image to the right. What if you want the image a different size, though? You could allow the browser to resize it for you, or – better yet – write your own php script to resize the image dynamically.
Read more…
A brochure-style Web site may be sufficient for a business that simply wants a basic Web presence — some static pages to inform the visitor of the company’s off-line contact information. But most organizations want a Web site that can interact with the visitor, delivering custom content in dynamically-generated pages, and storing visitor information in a database. Such a Web site requires several technologies: a Web server, a database system, and a scripting language for creating the Web pages. Currently the most popular choices are Apache, MySQL, and PHP, respectively.
Your PC can be turned into a fully capable Web development environment, by installing those three technologies, and configuring them so they communicate with one another. Admittedly, you can simply install and use PHP for its command-line processing. But for creating and testing dynamically generated Web pages on your local machine, then Apache needs to be already installed and working.
Read more…
One of the more surprising things you can learn about PHP is that it’s actually very useful when it comes to manipulating images of varying filetypes and formats. And a good thing too, since a lot of the internet is made up of pictures!
Read more…
This tutorial will teach you the very basics on how to use a PHP #include command. The #include command is used to insert the content of an external HTML page into an existing PHP page. For example, the header and footer of this page you are reading right now are actually external files which are loaded into the page when you request the server to display the page. Using this technique makes it easier to update the header of all the pages of our website by simple updating a single included header file without having to update any code in any of our pages.
Read more…
PHP is one of the most popular programming languages for the web. Sometimes a feature-friendly language can help the programmer too much, and security holes can creep in, creating roadblocks in the development path. In this tutorial, we will take a look at 5 tips to help you avoid some common PHP security pitfalls and development glitches.
Read more…