upon using fwrite for two variable $tilte and $contents u should add a
special pattern that u think it would not occur in the contents or title area.
Then u retireve the data with fread and then parse the result and retrieve the
title and content.
Like
$pattern="__SS__abc";
$title="My title";
$content="This is my contents for My title";
//Now write the $title to file
//As i dont remeber the exact code so i am using general code
%fp=fopen("data.txt","w");
fwrite($title,$fp);
fwrite($pattern,$fp);
fwrite($content,$fp);
//Now retrieve the data back
$data=fread($fp);
$pattern_pos=$data.indexof($pattern);
$title=$data.substr(0,$pattern_pos);
$content=$data.substr(($pattern_pos+$pattern.length()),$data.length());
Fahad N. Abbasi
globalsoho6 <[EMAIL PROTECTED]> wrote:
i'm really a newbie to php but not OOP.
i'm designing a database to hold simple text messages to display in a
page called, "News". The client doesn't want a sql database so I
suggested a plain text database. I have it working but when I pull the
data (fopen) it all comes back as one line.
It's set up as a simple form passing 2 variable, $title and $comments.
They both write (fwrite) just fine to the .txt file but upon
retreiving them (fopen) it's all one line. Since I can't pass formated
text to a .txt file is there a different way?
As a newbie I haven't come across a solution yet. The client wants
this soon so I'm asking here due to the timeline. Given a few more
weeks I'm sure I'd stumble across it in some text.
Thank you!
dan
dan burfield design.com
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
SPONSORED LINKS
Php mysql Job postings
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "php-list" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Bring words and photos together (easily) with
PhotoMail - it's free and works with your Yahoo! Mail.
[Non-text portions of this message have been removed]
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/