

- #Using microsoft expression web how to
- #Using microsoft expression web install
- #Using microsoft expression web code
The content from AutoGal.php will now be included in Chapter8.php via a server-side include. Select all of it (including the opening PHP delimiter “ ”).
#Using microsoft expression web code
In the Code pane, locate the PHP code you have been working on. In the next few steps, you will use more of the Expression Web PHP tools to make the code you’ve been working with more useful and reusable as well. jpg extensions, which is ideal for this particular gallery.Ĭlose the browser and return to Expression Web.

Notice that the previous broken image list item is gone. The if test skips any file name thatĭoesn’t include the extension “.jpg”-in other words, non-image files.Ĭlick Save and then click Preview on the Common toolbar to check your modifications in a browser. Preceding code) and an if statement that makes sure the file name contains What you’ve done is added a variable to contain the file extension “.jpg” (the first bold line in the Change the code so that it looks like the following: $dir = new DirectoryIterator('images/gallery1')

Improve the image listįind your PHP code block from the previous steps in the Code pane. Secondly, the bulleted list is hardly a “gallery.” In the next few steps you will remedy both those issues. PHP tries to display that directory in an image tag, which of course doesn’t work. This is because the PHP script looks for all the files in the Image folder, and one of those files is a hidden metadata folder that Expression Web uses to manage the site. First, if you scroll through the list, you will see a broken image icon. If you were to add additional image files to the /images/Gallery1/ folder, those images would also be included in the list in other words, the list updates itself automatically.Ĭlose the browser window and return to Chapter8.php in Expression Web.Īlthough the PHP worked, there are a couple of things that are sub-optimal. You have created a script that gets the file name of every file in a specific folder, and then displays them as a list of images. Consider what you’ve been able to do with just a few lines of PHP. Take a few minutes to examine the page in a browser.
#Using microsoft expression web install
It is here to expose the reader to the PHP tools available in Expression Web, particularly the Insert menu items, IntelliSense, and the Expression Development Server.įor the Expression Development Server to process PHP code, you must install PHP and set the path in either the Expression Web Application or Site Settings. The PHP coverage in this book is not intended to be an example of best practices, or current PHP coding standards. At the end of the chapter, you will find references to more information about programming in PHP.
#Using microsoft expression web how to
You will also learn how to work with PHP functions, variables, and includes in Expression Web 4. You will use PHP to create a list of all the images in a folder automatically. In this portion of the chapter, you will become familiar with the Expression Web 4 tools for PHP and how to use them. This section serves purely as an introduction to the PHP tools in Expression Web. Programming in PHP is a very broad topic, and is well outside the scope of this book. Microsoft Expression Web 4 provides several tools to make working with PHP easier, and also provides assistance in creating and previewing PHP files. In other words, PHP pages can mix PHP code with HTML markup and other content. PHP pages may serve text, HTML, and script blocks, and function similarly to “Legacy ASP” pages. When a browser requests a PHP page, the server executes the PHP script and sends the resulting HTML and other content to the browser. As long as your server has PHP installed, you can use it regardless of the server type (such as Linux or Windows). PHP is a powerful, platform-independent server-side scripting language.
