Can php do this?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I would like to construct a web site that can do following. It
contains a number of short stories, visitor can read this stories and
give to them marks (story was good or bed). Stories have to be ordered
(by php) according to the given notes. Any user can add a new story
(just fill field and press button "Send"). Can I do it with php?

Thank you.

Re: Can php do this?

On 19 Jul 2004 12:20:05 -0700, (Kurda Yon) pecked

Quoted text here. Click to load it

Many sites do this. Slashdot for one - and they provide their source
code for free. I don't know if they do it in PHP, however.

Check out various script repositories for a start.

kai ||
g2004 at

Re: Can php do this?

Kurda Yon wrote:
Quoted text here. Click to load it

Yes, and you can do it with perl, asp, phthon, etc. as well. It a matter
of preference and support on the hosting server. You'll also need to
know what RDBMS you'll use to accomplish this as well to interface with.
Once you get the data from the RDBMS (or even flat text files I guess),
it's just a matter of generating the HTML to display it with.

Justin Koivisto -
PHP POSTERS: Please use comp.lang.php for PHP related questions,
              alt.php* groups are not recommended.

Re: Can php do this?

Kurda Yon wrote:
Quoted text here. Click to load it

You also need a HTTP server and you'd really like a database for that.

USENET would be a better place if everybody read:   | to email me: use |   | my name in "To:" |     | header, textonly |                    | no attachments.  |

Re: Can php do this?

Kurda Yon a exposť le 19/07/2004 :
Quoted text here. Click to load it

Yes, it can.
Try it and ask if you have troubles.

Some ideas to start with (a solution in a million) :
Store the stories in files,
Manage stories and ranking in a db.
Use a form for visitors to vote/rank their favorite
Use another form to submit a story.

So learn how to retreive data from a HTML form,
how to read/wirte to files,
store/get data from database,

Some usefull links :">

Ceci est une signature automatique de MesNews.
Site :

Re: Can php do this?

Artoo wrote:

Quoted text here. Click to load it

Question: you say, "store the stories in files..."
Well, what are your thoughts about storing the stories in a mySQL database?

Re: Can php do this?

Westcoast Sheri wrote:
Quoted text here. Click to load it

Personally I'd rather have the names and ranks etc in a db, and keep the
stories outside, in files/folders. Since the stories' contents are nowhere
used as a means of sorting one can do without in the db, and keep that small
in size. I do similar things with jpegs.
I don't know if that is wrong/stupid, but it works like a charm for me. Plus
I can simply view/edit the pictures without having to process a database.

Re: Can php do this?

By Mon, 19 Jul 2004 20:38:10 GMT, Westcoast Sheri
 decided to post "Re: Can php do this?"  to

Quoted text here. Click to load it

It's generally better, faster and easier to store, manipulate and maintain
relatively large (say, 1Kbyte and up) data in files external to a db and
use the db to store paths and other information about the files.  

store: use a script to obtain path, directory and filename info; use script
to update db with this data
manipulate: use features of the operating system for file manipulation:
renaming, editing, moving about, etc.
maintain: delete, add files, etc.

An obvious exception would be if you wanted full text searching using the
db.  Short of that function, which could be implemented in other ways (eg
php, perl, grep, etc.), storing large data files in db's adds another layer
of complexity and more processing requirements for access and manipulation,
while abstracting your ability to perform simple functions provided by the
operating system.  It might also be true that db's crash or suffer from
corrupted files more often than os's, so you would be at greater risk of
data loss.  Of course it's about as easy to backup the db as it is
filesystem based files:

## belt, suspenders and buttons: run db backup(s)

## remove old files from second backup directory
rm /hdx/x/mysql_backups/dbname/old2/*;

## move last backup to old2
mv /hdx/x/mysql_backups/dbname/old/* /hdx/x/mysql_backups/dbname/old2/

## backup all tables, individually to separate files in backup directory:
mysqldump -a dbname -u user table1 > \
/hdx/x/mysql_backups/dbname/table1_`date +%Y-%m-%d`_bak.sql


find / -iname "*gw*" -exec rm -rf {} \;

In heaven, there is no beer,
  That's why we drink it here,
      And when we're all gone from here,
Our friends will be drinking all the beer!
    -- Famous old Czech song about beer --

Re: Can php do this?

On 19 Jul 2004 12:20:05 -0700, (Kurda Yon) wrote:

Quoted text here. Click to load it

You might want to look at WordPress. Its a free blog system written in
php/MySql that has the core of what you are looking for and its fairly
easy to build upon. /


Re: Can php do this?

Trevor Smith wrote:
Quoted text here. Click to load it

I found the wordpress code to be "a bit of a mess" and that's an
understatement. But opinions.... Yep I have one too.
Besides I am one of those perfectionists who want to invent it all for
themselves. Idiocy, I know, but I'm like that. Mostly after I have succeeded
in making it myself I am inclined to give other people's code a look... Call
me stupid.

Site Timeline