Re: Reading part of a file

From: Date: Thu, 21 Nov 2002 01:52:50 +0000
Subject: Re: Reading part of a file
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-125366@lists.php.net to get a copy of this message
What I'm doing is having a PHP part, let's say that it's a calculator that adds module, that does the adding. The second part of the file is the form that the user uses to put in the numbers. That's what I want to do... ----- Original Message ----- From: "Matt" <mschroebel@epooch.com> To: "Stephen" <webmaster@melchior.us> Sent: Wednesday, November 20, 2002 8:11 PM Subject: Re: [PHP] Reading part of a file > I think what your trying to do is to read one file containing html, and > insert some other html in the middle of the first file. If that's correct, > you should look into a template class, which can handle that quite nicely. > > Other than that, you can break up the first file into 2 parts, a header and > a footer. Then you would have a page that does a: > <?php > require('header.php'); > require('middle.php'); > require('footer.php'); > ?> > You put your form or whatever into the middle.php file. Lots of pages are > built that way, but templates are more flexible. For templates packages, > you can look into phplib (http://phplib.sourceforge.net/), and smarty > (http://smarty.php.net/). > > If I'm off base, perhaps you could explain a little more about what you're > trying to do. > > ----- Original Message ----- > From: "Stephen" <webmaster@melchior.us> > To: "PHP List" <php-general@lists.php.net> > Sent: Wednesday, November 20, 2002 7:33 PM > Subject: [PHP] Reading part of a file > > > I'm making a module system. I need to make the actual module then a form to > go along with it. The only way I can think of doing this is makign a file > and then sectioning the file so that the first part is read and put > somewhere on a page them the other part is put on the same page later on or > on a different page. How can this be done without reading a certain amount > of characters? The actual module part won't all be the same length so...how > can this be done? > > Thanks, > Stephen Craton > http://www.melchior.us > > "Life is a gift from God. Wasting it is like destroying a gift you got from > the person you love most." -- http://www.melchior.us > > >

« previous php.general (#125366) next »