#1
  1. No Profile Picture
    leander
    Guest
    Devshed Newbie (0 - 499 posts)
    Hello,

    I' ve got a messageboard, which is in CGI. It uses a file named toc.dat to display the messages. Here is how this information is stored:

    1790|~%|0|~%|12-12-1999|~%|18:16|~%|name|~%| |~%|subject
    1789|~%|0|~%|12-12-1999|~%|18:07|~%|name|~%| |~%|subject
    1791|~%|1|~%|12-12-1999|~%|18:26|~%|name|~%|email|~%|subject

    As you can see, each line starts with a message-identifier.
    Now, I would like to use a PHP3-script, which displays the last 5 entries on the main page of my website. Is it possible to extract the subject out of this dat-file?

    I have only just begun to learn php and cgi, so please be elaborate


    Thank you very much....
    Leander
  2. #2
  3. No Profile Picture
    Darguz
    Guest
    Devshed Newbie (0 - 499 posts)
    Try the explode() function:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $entry=explode("|~%|", $logline);
    [/quote]

    The subject will be in $entry[6].

    ------------------
    Alan Little
    Holotech Web Design
    www.holotech.net/




    [This message has been edited by Darguz (edited 12-12-99).]

Similar Threads

  1. Email server newbie needs help!
    By Talon in forum Mail Server Help
    Replies: 2
    Last Post: January 13th, 2004, 12:20 PM
  2. web database design totally newbie
    By spyghost in forum Database Management
    Replies: 2
    Last Post: September 2nd, 2003, 02:36 PM
  3. newbie Looking For A Good Starting Book
    By ryanjulian in forum PHP Development
    Replies: 4
    Last Post: August 22nd, 2003, 02:13 AM
  4. VB newbie queries?
    By Jollyguy in forum Visual Basic Programming
    Replies: 1
    Last Post: March 13th, 2003, 08:44 AM
  5. Linux book suggestions for newbie
    By stujohnson in forum Linux Help
    Replies: 1
    Last Post: April 30th, 2002, 09:08 AM

IMN logo majestic logo threadwatch logo seochat tools logo