RE: [PHP-WIN] News with MySQL
| From: | Mangiola Nunzio Datavia | Date: | Thu, 15 Mar 2001 13:45:24 +0000 |
| Subject: | RE: [PHP-WIN] News with MySQL | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6062@lists.php.net to get a copy of this message | ||
Thanks. But you misunderstood.
What I want to do is strip the first part of the html
document and display it. Then have a link that will lead to
the rest of the document. So you see there is no physical
split but a virtual split. The reason I don't use the method
that you have is because I don't always get standard
html files and I don't want to have to edit them.
This is my stripper code:
<?php
if ( $fp = fopen( "http://server/dir/retrieve.php?id=18",
"r" ) )
{
while( ! feof( $fp ) )
{
$line = fread ($fp, 500);
if ( ! strpos( $line, "<P>" ) === false )
{
echo $line;
break;
}
}
fclose( $fp );
}
?>
<A HREF="news0.php"
target="_top"><FONTSIZE="2">...More</FONT></A>
I have now found a way to strip from the database. What I need now is
a way to strip the latest posting and then 4 or five earlier onse for
display in a table.
I aim the striper at a retrieve code:
<?php
// getdata.php3 - by Florian Dittmer <dittmer@gmx.net>
// Example php script to demonstrate the direct passing of binary data
// to the user. More infos at http://www.phpbuilder.com
// Syntax: getdata.php3?id=<id>
if (isset($id)) {
// you may have to modify login information for your database server:
MYSQL_CONNECT("server","user", "password");
mysql_select_db("bin_data");
$query = "select bin_data,filetype from binary_data where id=$id";
$result = MYSQL_QUERY($query);
$data = MYSQL_RESULT($result,0,"bin_data");
$type = MYSQL_RESULT($result,0,"filetype");
Header( "Content-type: $type");
echo $data;
};
?>
Thanks for the suport I hope I get it right.
> ----------
> From: Asendorf, John[SMTP:JAsendorf@lcounty.com]
> Sent: Thursday, March 15, 2001 3:30 PM
> To: Mangiola Nunzio Datavia; php-windows@lists.php.net
> Subject: RE: [PHP-WIN] News with MySQL
>
> I'm doing the same thing kind of differently. Instead of storing the
> first
> paragraph seperately from the whole story I'm just reading up to the first
> <br> (which I insert when the story is typed in by the user)
>
> The code for just using the first paragraph looks like this:
>
> else {
> $story = split ("<br>", $story, 2);
> echo "<P>$place - ${story[0]} <a
> href=\"${full_story_page}?print=true&story_key=$key\">Read
> more...</a></P>\n\n";
> }
>
> $story is the whole story pulled
>
> The split breaks the story up in to bieces by <br>'s and then the
> ${story[0]} just uses the first piece...
>
> Good Luck!
>
> ---------------------
> John Asendorf - jasendorf@lcounty.com
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> Aut insanit homo, aut versus facit
>
>
> > -----Original Message-----
> > From: Mangiola Nunzio Datavia [mailto:NunzioM@Datavia.co.za]
> > Sent: Thursday, March 15, 2001 1:46 AM
> > To: php-windows@lists.php.net
> > Subject: [PHP-WIN] News with MySQL
> >
> >
> > Hi
> >
> > What I would like to do is save a news
> > item as a html or text file. Then place it into
> > a MySQL database. Afterwards I would like
> > to display the fist paragraph of each news
> > posting on a site in a summary format.
> >
> > If the user would like to see more all
> > he has to do is click on the corresponding
> > link and it will take him to the full story.
> >
> > Now I know how to upload files and download
> > full files from the database. I also
> > know how to strip the first paragraph of an
> > HTML file. But how to put them
> > together?
> >
> > Anybody got any pointers?
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-windows-help@lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> >
>