Explore the Premium Content

Dynamic Menus with ASP and CSS

Many database-driven web sites are run from some form of content management system, and so navigation menus need to be dynamically created – with the links being pulled from the database. Working in this way means that you may not know how many links will appear in a navigation menu when you design the site, as the number will depend on how many are stored in the database at any one time.

This tutorial explains how to create a menu from a list of links stored in an Access database, using the ASP Server Model and the Dreamweaver Server Behaviors, covering creating the database table, connecting to the database, creating a Recordset and using a Repeat Region to display the data. Once we have created the menu using ASP, we will then
use CSS to style it in an attractive and code efficient manner that will work well no matter how many links are displayed.

This tutorial is suitable for complete beginners in CSS and ASP, and is compatible with MX and MX2004 and above.

Read More

PHP: Dynamic Arcs, Circles and Polygons

Not all graphics on web pages are for design only. A lot of sites used in business or financial reporting need to show dynamic information graphically, and because that information updates constantly, the graphs need to be drawn on the fly. In this weeks tutorial we will continue on with some more complex shapes – curves, ellipses and polygons. We’ll also take a look at some of the maths involved with drawing polygons. As the series progresses, this will lead up to a routine that will plot graphs on the fly from dynamic data.

This tutorial contains some maths, but the code is provided and is suitable for intermediate PHP developers using either Dreamweaver MX or MX 2004.

Read More

Dynamic Web Development: ASP Foundations

So you want to start learning how to design dynamic web sites that make pages on the fly customised for the user? Or take advantage of all that logon-functionality? Or don't want to code a seperate html page for every product in your on-line catalogue?

Then you need a dynamic web site. The most common way for Dreamweaver users to get into dynamic web development is to use the ASP language. Rob explains concepts and code so that you can start to use the built in ASP server behaviors and extend their limited functionality with your own hand-crafted ASP code. This tutorial looks at the "life cycle" of an ASP page.

Read More

PHP Shape drawing tools

In a number of tutorials towards the end of last year we took a look at working with images in PHP.  The functionality and techniques that we looked at all worked with existing images that you had already taken with a digital camera, scanned in, or created yourself.  We saw how to make thumbnails, save these thumbnails in different formats and how to play with the colours within these images.  And this is all great if you have existing images to work with, but what happens if you want to draw simple shapes dynamically within your image?  The image functions within PHP can also do this and there are a number of functions, some of which you have already seen, that allow us to do this.
 
When most people think of creating images for web sites, they think of a program like Adobe Photoshop or Macromedia Fireworks and think of all the creative things they can do to make the page look good.  With enough time and effort you could get similar results using the PHP image functions, but this is not why we use them – these functions are aimed at more practical uses for images – creating simple navigation buttons on the fly, drawing maps or diagrams from raw data, annotating existing images or drawing graphs from dynamic data.
 
In today’s tutorial we will take a look at some of the basics for drawing shapes on an image; this tutorial can be used by itself, or as part of a series over the coming weeks which will demonstrate how to build  diagrams and charts on-the-fly from dynamic data. Read More

Using the .NET Collection Classes Part 2

This tutorial is the final part of a 2 part series on .NET Collections, and focuses on a real world use for the ArrayList class. It will demonstrate how to use an ArrayList collection to display all the image files stored in a directory as well as display each image file’s associated file information. The display layout of the images and data is handled using a DataList control. The image browser will also utilize classes in Namespaces other than System.Collections to incorporate paging, providing the end user with a mechanism to view a specific number of images per page view and also to display image specific file system information.  Read More

PHP: Working with Image colour

Using the free GDLib extensions to PHP, we can dynamically make thumbnails, save images to disc and manipulate them in other ways. in this tutorial, Allan shows how to manipulate the colours within an image, either to tint them or greyscale them (we've seen this technique used in an application that allows you to upload images into an on-line "newspaper" complete with black and white photographs!).

This tutorial assumes no prior knowledge of PHP. Read More

PHP User comments system

In this tutorial, we’re going to build a system to allow users to add comments to the bottom of your web pages, which is becoming more and more popular lately for a variety of different applications. For example, blogs are now starting to allow users to add comments so readers can join in the discussion, and tutorials have comments sections where users can add their own notes, or comment about the brilliance of your writing for example. The system could also be used to create a guest book application for a site; in fact the principles can be used for pretty much any system which allows users to add data.

We first build a page that allows the user to add comments, which are then stored in a table in a MySQL database. We place the MySQL connection parameters in an include file, so they can easily be added to any page which uses the database, without having to retype them each time, and so they are easily changeable in future if you change servers for example.
 
We then create a PHP include file which can be added to an existing page to show the relevant comments from the database for that particular page.  Read More

ASP.NET CodeBehind and Code Re-Use Using Inheritance

CodeBehind is when the HTML portion of the page that contains the HTML mark-up and the server side code are separated into two files. This allows designers to make modifications to the HTML without messing up the programmes server side code. It also allows programmers to edit their code without messing up the designers HTML. When the server side code is compiled into an assembly (DLL) each section of the page can even be published to the server separately.

Dreamweaver users do not have native support for CodeBehind like Visual Studio .NET users have, so this article will go some way towards redressing the balance.

This tutorial will guide you through implementing ASP.NET CodeBehind and Code Re-Use techniques using a .NET feature known as Inheritance. You will learn how to define and use your own class files, about re-using and extending existing .NET Classes using Inheritance. For one example the article will outline how to create a new type of Button Server Control that derives from the standard ASP:Button Server Control, and extends its capabilities by adding an “Are you sure you want to do that?” prompt upon clicking the button. You will also learn how to implement CodeBehind in your ASP.NET applications using only Dreamweaver and how to compile your code into assembly (DLL) files.

The following topics will be covered:

  • An introduction to Classes in .NET
  • An introduction to Class Inheritance in .NET
  • An introduction to ASP.NET CodeBehind
  • Implement CodeBehind Classes in a page
  • Utilize Code Re-Use with CodeBehind Classes
  • Extending the Button Server Control
  • Compiling the Button Server Control
  • Using the extended Button Server Control in a page

As usual, Kevin gives his sample code in both C# and VB.NET - the two most-used languages for coding ASP.NET pages.

Read More

Saving PHP thumbnail data

In today’s tutorial we write a series of PHP scripts that allow a page to take a user-uploaded image, resize it - and generate a thumbnail of the image that is uploaded.  We’ll then take that thumbnail data and save it in a database.  When we look at how we can save our images in a database, we’ll have to look at how we can first change the binary data so that it is safe to store in the database, as well as taking a look at how PHP can ‘buffer’ its output. This tutorial utilises the free GD library. Read More

Using the .NET Collection Classes

This tutorial which is the first part of a 2 part series will give an introduction to the Collection classes built-into the .NET Frameworks System.Collections namespace; these classes are used to hold collections of values or objects in memory and are commonly known as arrays. The three commonly used collection classes are ArrayList, Hashtable and SortedList, this tutorial will serve as an introduction to these classes. An example use for these collection classes could be to store user specific data in a collection class that can itself be stored in a session variable allowing data to be shared easily across multiple pages. Read More

Thumbnail generation with PHP

In this tutorial we will be taking a look at how we can open existing images, check on their current dimensions and then intelligently do a proportionate resize on them., dynamically creating thumbnails on the fly to display in the browser.

In previous tutorials we have looked at how we can set up PHP so that our extensions are correctly installed. Rather than covering that again, this week we will look at ways that you can check if the extension that you want is installed and supports the things that you want to do. We will be working with the free GD extension.

Read More

Creating Calendars in PHP – Part 4

In this last part of the series on creating a calendar application in PHP, we create an include file to hold the parameters required to connect to the MySQL database. Next, we create a page that displays all calendar events on a particular day, using the date which is passed as a URL parameter to find the correct records from the database.

Then, we create a page which allows a user to easily add events to the database through a simple web interface. Finally, we create a multi purpose page that allows a user to edit existing records in the database, or delete a calendar event from the database.

All the code is provided for download, so if you haven't followed the previous tutorials, it's all available for you to build this sophisticated calendar application for your users.

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
Newer articles Older articles