View Single Post
Old March 2nd, 2004, 12:42 AM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts

Well I don't know if IIs has a .htaccess equivalent. I did a bit of searching on the topic and I don't think so. I think you'd be better off with an apache server. That's very strange that they can't get PHP working with Apache on a Linux machine.. PHP being a member of the open source family and all.. as far as I know most Linux distributions already come with Apache, PHP and MySQL. Anyhow, if it comes down to you *not* being able to append/prepend files you can always do it the manual way.. just include the code in every file that needs protection. It isn't as dynamic but it works. And like I said before this isn't the *only* solution to the problem. You can use templates, a DB backend instead of directories, HTTP authentication.. there are several solutions to this problem.

The <?php and ?> can indeed be broken up like that, in fact besides regular if/else chains you can do it with loops too. PHP remembers all the variables and whatnot from block to block. This is one of the main features that distinguishes PHP from Java and Perl and other languages. You can open and close PHP blocks as much as you want throughout a page. I beleive ASP can also do that.

<?php $foo = 'Hello, World!'; ?>

      <title><?php echo $foo; ?></title>

Smiling Souls