Explore the Premium Content

Creating Dynamic Images from PHP

In today’s tutorial, we will take a further look at the kinds of things that you can do with PHP using one of the PHP extensions. As we have mentioned before, PHP is easily extended to include support for a variety of different 3rd party file types and protocols. Today we will start looking at an extension that lets you create images – the GD extension. This is easy to install (instructions are given) and a tutorial project is included, involving getting the EXIF data of a digital camera image, grabbing a thumbnail through the free GD library. Read More

Generating Dynamic Bar Charts with ASP.NET

This tutorial will walk you through how to generate a dynamic bar chart image for displaying numeric data to your users in an easy-to-digest format. During the course of this tutorial you will learn about the classes that reside within the .NET Frameworks System.Drawing namespace, and how these classes can be used to vastly improve the user experience of your pages.
 
The code presented in this tutorial can be used to generate bar charts, like the image shown below, that can be based on any type of numeric data; this data could be stored in a database, passed from the user via a form or any other source. This tutorial does not require any third party components; all that’s required is natively built into the .NET Framework.

As usual, ASP.NET expert supplies all the code for download in the C# language and  VB.NET
Read More

Database Design: Simple SQL Queries

In today's beginners' Database tutorial, we explore a sample database model for a relatively simple system. In it we  look at some good examples of the different types of relationships that tables can have in a database. We then look at a couple SQL queries based on this model.

Rob then gently takes you to the world of  SQL JOINs and how we can use them to create information from data. We also modify data in a table, through the INSERT, UPDATE and DELETE queries. We finish up with a unique example of how to filter data, through the use of the NOT IN keywords and a nested query.

Read More

Creating Calendars in PHP part 3

In this article in the series, we look at using the PHP mktime() command which allows us to create Unix timestamps for a particular date and time. By using the PHP explode() command we can split a time or date that's been entered by a user into its component parts for use with the mktime() function. We then look at the PHP strtotime() command which can perform date and time based addition and subtraction, so we can easily add or subtract a period of time to or from an existing date / time.

In the final section, we create a custom function readCalendarData() which accepts a month number and year, and searches the database to find all events on or between the start and end of the month and using SQL to turn the datetime field into a timestamp field to make it easier to work with, and to allow us to easily sort the records into order of date and time. We then modify our existing calendar code so that it checks to see if each day number exists in the array, and if it does to turn the day number into a hyperlink to allow the user to see all events on that particular day.

Please note that this article forms part of a chapter in the DMXzone e-book PHP Web Applications for Dreamweaver: Juicy Solutions for the Busy Developer.

 

Read More

Flash Gordon and the attack of the PHP Extensions

The basic PHP language is feature-rich and powerful enough for you to handle most web applications without any hassles. And if you’re working with PHP mainly by using the built-in Server Behaviors that come with Dreamweaver and a little bit of hand coding, you are missing out on a whole host of functionality within PHP.

This extra functionality comes through PHP’s use of extensions – libraries of code that can be loaded into PHP as and when you need them. In today’s tutorial we’ll take a look at the kinds of things that these extensions can do, talk a bit about a PHP data type that is often used when you work with PHP extensions, and then take a look at how one of these extensions work by looking at the Ming extension for PHP.

Read More

Creating Calendars in PHP – Part 2

In this tutorial we look at the advantages of removing HTML attributes from the PHP code and replacing them with CSS classes, so that the whole dynamically-produced calendar can be restyled just by changing the CSS styles and without having to change the code in any way.

We then look at the MySQL datetime field format which stores a date and time in a format which can be easily changed into a timestamp using the MySQL UNIX_TIMESTAMP() command. We look at the advantages of using the Unix timestamp format, such as making it easy to select dates using simple numerical operators and being able to automatically sort records in order of date and time.

Finally we learn how to select all events that fall on a certain date, and then at how to find all records which fall between a range of dates.

Please note that this article forms part of a chapter in the DMXzone e-book PHP Web Applications for Dreamweaver: Juicy Solutions for the Busy Developer.

 

Read More

Working with the Server's file system using ASP.NET

This tutorial explains how to carry out many common tasks relating to the accessing and manipulating a server file system, including listing files and directories, checking for the existence of a specific file or directory, reading and writing text to text files, copying, moving and deleting files and directories. You will also be shown how to obtain statistics of directories and files such as file size and modified dates. By the time you have worked through this article you will be more knowledgeable about file system access and manipulation using the powerful classes provided within the .NET Framework.

The tutorial covers the following subjects:

  • Writing text to a file
  • Reading text from a file
  • Finding out if a file or directory exists
  • Renaming a file or directory
  • Copying and moving a file or directory
  • Deleting a file or directory
  • Listing the contents of a directory
  • A hierarchal listing example
  • Common problems and errors

We end the tutorial with an example of displaying the contents of a directory using a recursive routine to show the hierarchy of its contents in much the same manner as a tree control would display them.

Read More

Building ASP.NET HTTP Handlers

In this tutorial, Chris Ullman shows you how to build your own HTTP handlers using ASP.NET. HTTP handlers can let you intervene and handle a request for a particular type of page, and make it possible to catch URLs that are submitted by a user and rewrite them in a format required by the web site, to disguise long, cumbersome URLs or to process filetypes not gererally dealt with by the server - for example, custom handling of new XML types.

Read More

ASP.NET Data Binding and Alternate-coloured rows.

Data binding is one area where ASP.NET really improves in leaps and bounds over what classic ASP offers. The power is there - but the syntax is murky and confusing. This tutorial serves as an ideal introduction to the novice for data binding and what templates are used for in ASP.NET., and cuts through Microsoft's tricky doucmentation to bring the power of ASP.NET databinding and template to the beginner.

Chris demonstrates how to use databinding by building up the code for a template that automatically displays a list of records with alternate coloured rows, making it much more attractive and easy to read for the user.

Read More

Creating a Simple Email Form in PHP

You want your site's visitors to be able to contact you (to offer you work, marriage, congratulations on your genius etc) but, as soon as you put your email address on the site, you're inundated with spam and Nigerian gentlemen offering you $5 million. This tutorial shows you how to make a simple email form in PHP so that a form can be mailed to you when the user hits the submit button. Gareth then shows how to make a simple HTML mail, as well as a useful tip on how to make helpful hints appear in the status bar while the user fills in the form.

This is suitable for beginners to advanced users of PHP.

Read More

ASP.NET Forms Authentication

ASP.NET has powerful server-side user authentication built into it that automatically encrypts authentication cookies and information and can be used to allow users or throw them out of a system accoding to security levels set by the site owner.

Documentation about these features is sparse and complex. Chris Ullman walks you through the ASP.NET authentication procedures, explaining how to customise it to your own requirements.

This tutorial is suitable for intermediate ASP.NET developers.

Read More

File Uploading with PHP

In this article we look at how to upload files using PHP. This technique can be extremely useful, and is used on many sites for example, in content management systems or forums which allow the user to upload an image to represent them.

In this standalone tutorial, we start by looking at how to create the HTML form required to upload files. We then look at how to upload a single file, and then expand the code to allow multiple files to be uploaded. Finally we look at some useful file handling commands, and how to read the dimensions from an image file.

This is suitable for MX and MX 2004 users, from beginners upwards.

Read More
Newer articles Older articles