PHP and file extensions

From: Date: Thu, 20 Mar 2003 02:26:57 +0000
Subject: PHP and file extensions
Groups: php.general 
Request: Send a blank email to php-general+get-140383@lists.php.net to get a copy of this message
Still working on this authentication script and have a small question. Each page on the site needs to have one line of code on it so it can't be accessed unless you log in - is there a way to have this line in an html file without changing the extension to .php? On the same note, there is a small script called Zoom Version 1.7.0 which is a search engine that search's for content on your site, but the way they are doing this alludes me. In the search.htm file there is a line - <!--ZOOMSEARCH--> - which somehow inserts the results of your search. In the results.php file this is the relevant code, but I'm not quite sure what's going on here. Any comments are appreciated..... //Open and print start of result page template $template = file ('search.htm'); $numtlines = count ($template); //Number of lines in the template $line = 0; while (! stristr ($template[$line], "<!--ZOOMSEARCH-->") && $line < $numtlines) { echo $template[$line]; $line++; } $line++; //Replace the key text <!--ZOOMSEARCH--> with the search result

« previous php.general (#140383) next »