Re: PHP from CD-ROM

From: Date: Wed, 06 Dec 2000 13:12:43 +0000
Subject: Re: PHP from CD-ROM
Groups: php.general 
Request: Send a blank email to php-general+get-28889@lists.php.net to get a copy of this message
Why don't you just write TWO copies of every example, one is the php code, and the other is the HTML that it generates. -- example1.php -- <?php echo "<h1>\n"; echo "Hello world.\n"; echo "</h1>"; ?> -- example1.html -- <h1> Hello world. </h1> Dusty Cohen ------------------------------------------- MySQL php4 50 megs $9.99 http://TerribleHost.com ------------------------------------------- I'm running a web site where I also want to be able to deliver a version on CD-ROM. The live web site contains links to PHP files, which obviously won't work if the end user is accessing the CD-ROM from their home computer. Right now, if the user clicks a link to a .php served from the CD, the browser fills the window with PHP source -- obviously not the best solution. Yes, I could produce a version which does not use PHP -- the links instead go to pages that say 'you have to be online to use this'. However, I don't want to get into multiple versions if I don't have to. I'm going to check out Javascript to see if there's a way to differentiate the cases. Has anyone come up with a better solution for this?

« previous php.general (#28889) next »