Connecting Tech Pros Worldwide Help | Site Map

basic tutorial

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 10:49 AM
Andy T
Guest
 
Posts: n/a
Default basic tutorial

hi

I am after a basic tutorial that uses PHP to create a web page from a
text file.

All i can find it PHP tuorials that include MySql and I dont need that
just yet. I am in urgent need of sorting this quickly and more
learning can come later.

I do have a script http://www.8thrallycross.co.uk/bnb/bnbform.html

that takes all the info for booking in and places it in a text file
(simulated) at http://www.8thrallycross.co.uk/onlinebooking2.shtml

and what I need to do is get the required info across to a web page
similar to this.

http://www.8thrallycross.co.uk/onlinebooking.shtml

Any help and advice appreciated
Regards Andy T



--
For users by users - BY-users group
<http://www.by-users.co.uk>

  #2  
Old July 17th, 2005, 10:49 AM
CJ Llewellyn
Guest
 
Posts: n/a
Default Re: basic tutorial

"Andy T" <andy@westmidland-internet.co.uk> wrote in message
news:7lutu09k7896tglqk4r87baq3k6fctmavq@4ax.com...[color=blue]
> hi
>
> I am after a basic tutorial that uses PHP to create a web page from a
> text file.
>
> All i can find it PHP tuorials that include MySql and I dont need that
> just yet. I am in urgent need of sorting this quickly and more
> learning can come later.
>
> I do have a script http://www.8thrallycross.co.uk/bnb/bnbform.html
>
> that takes all the info for booking in and places it in a text file
> (simulated) at http://www.8thrallycross.co.uk/onlinebooking2.shtml
>
> and what I need to do is get the required info across to a web page
> similar to this.
>
> http://www.8thrallycross.co.uk/onlinebooking.shtml[/color]

<html>
<body>
<p align="right">
<?=readfile('somecontent.txt');?>
</p>
</body>


  #3  
Old July 17th, 2005, 10:50 AM
Richards Noah \(IFR LIT MET\)
Guest
 
Posts: n/a
Default Re: basic tutorial


"CJ Llewellyn" <invalid@example.con> wrote in message
news:csnqk8$lvq$1@slavica.ukpost.com...[color=blue]
> "Andy T" <andy@westmidland-internet.co.uk> wrote in message
> news:7lutu09k7896tglqk4r87baq3k6fctmavq@4ax.com...[color=green]
> > hi
> >
> > I am after a basic tutorial that uses PHP to create a web page from a
> > text file.
> >
> > All i can find it PHP tuorials that include MySql and I dont need that
> > just yet. I am in urgent need of sorting this quickly and more
> > learning can come later.
> >
> > I do have a script http://www.8thrallycross.co.uk/bnb/bnbform.html
> >
> > that takes all the info for booking in and places it in a text file
> > (simulated) at http://www.8thrallycross.co.uk/onlinebooking2.shtml
> >
> > and what I need to do is get the required info across to a web page
> > similar to this.
> >
> > http://www.8thrallycross.co.uk/onlinebooking.shtml[/color]
>
> <html>
> <body>
> <p align="right">
> <?=readfile('somecontent.txt');?>
> </p>
> </body>
>
>[/color]

The line that contains "<?=" may not work, depending on your PHP
configuration (whether or not you have short tags enabled, and I believe
they are disabled by default). If this is the case, replace it with:

<?php echo readfile('somecontent.txt'); ?>

But I'm not sure that the OP was really looking for that. Just printing the
text file verbatim isn't going to look very pretty.

Your method of storage is rather ugly, and sorting that out would be even
uglier. There is a reason most people use MySQL: it is easy and effective
for things like this. It would be worth your time to read at least one of
those MySQL tutorials that you mention. In my opinion, it will take longer
to learn how to solve the current problem you have (how to parse a file that
has been stored with no meaningful format) than it will to install MySQL,
learn the 4 or 5 functions you need, and use them instead.

-Noah


  #4  
Old July 17th, 2005, 10:50 AM
Daniel Tryba
Guest
 
Posts: n/a
Default Re: basic tutorial

"Richards Noah \(IFR LIT MET\)" <Noah.Richards@infineon.com> wrote:[color=blue]
>
> <?php echo readfile('somecontent.txt'); ?>
>[/color]

This will also print the filesize of the file, lose the echo :)
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.