PHP and Expression Web or Sharepoint Designer
If an upgrade could tick a person off more. The replacement to frontpage is not compatable with php yet. I copied the below from a website (http://forums.webworkshop.org/showthread.php?p=13107) that explained how to make it work:
PHP Includes in Expression Web
--------------------------------------------------------------------------------
I am doing my first website entirely in Expression Web. As I no longer have the convenient include pages of FrontPage I'm using PHP includes instead. However, they weren't working as they should have.
I discovered that there are three hidden characters Expression Web adds at the very beginning of all HTML, PHP, CSS, and (possibly) other files created by Expression Web. You cannot see these hidden characters in Notepad. I had to go to a cmd prompt, then navigate to the directory with my files and do a "type filename.htm". When you do this you can see the strange characters at the start of the file. After some research I discovered these strange characters are called a "byte order mark" (BOM). Strangely, Expression Web will let you turn off the BOM for CSS pages but not HTML/PHP pages.
To eliminate the BOM you can select "US/Western (European) Windows" encoding in Site > Site Settings > Language. This adds a meta "content-type" tag, and if this is in place Expression Web won't add the BOM. But for pages without head tags (like included PHP code) Expression Web insists on defaulting to UTF-8 and adding the BOM.
I figured out a workaround for this. Adding the following to the top of PHP pages will "trick" Expression Web into not adding the BOM:
Code (NOTE add the <>):
?php /* ?
meta http-equiv="Content-Type" content="text/html; charset=windows-1252"
?php */ ?
The PHP lines are comments. Expression Web will see the meta tag and not add the BOM, but the PHP comment tags mean the server will ignore the line and not even send it to the browser.
This workaround really shouldn't be necessary. Microsoft should just give us a way to turn off the BOM in HTML/PHP pages (as I said above, they already give you that option for CSS pages). Until then, the above will get you going if you want to use PHP includes with Expression Web.
