Can php do this? | | |
Hi,
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?
Kurda Yon a exposé le 19/07/2004 :[color=blue]
> Hi,
>
> 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.[/color]
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 : http://www.php.com http://www.mysql.com
--
Ceci est une signature automatique de MesNews.
Site : http://mesnews.no-ip.com | | | | re: Can php do this?
Kurda Yon wrote:[color=blue]
>
> 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?[/color]
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 - spam@koivi.com
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:[color=blue]
> 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?[/color]
Yes.
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 | http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" | http://www.netmeister.org/news/learn2quote2.html | header, textonly | http://www.expita.com/nomime.html | no attachments. | | | | | re: Can php do this?
Artoo wrote:
[color=blue]
> Kurda Yon a exposé le 19/07/2004 :[color=green]
> > Hi,
> >
> > 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.[/color]
>
> 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.[/color]
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:[color=blue]
> Artoo wrote:
>[color=green]
>> Kurda Yon a exposé le 19/07/2004 :[color=darkred]
>>> Hi,
>>>
>>> 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.[/color]
>>
>> 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.[/color]
>
> Question: you say, "store the stories in files..."
> Well, what are your thoughts about storing the stories in a mySQL
> database?[/color]
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.
Pjotr | | | | re: Can php do this?
On 19 Jul 2004 12:20:05 -0700, kurdayon@yahoo.com (Kurda Yon) pecked
out:
[color=blue]
>Hi,
>
>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.[/color]
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 www.perfectreign.com || www.filesite.org
g2004 at g3prod.cotse.net | | | | re: Can php do this?
On 19 Jul 2004 12:20:05 -0700, kurdayon@yahoo.com (Kurda Yon) wrote:
[color=blue]
>Hi,
>
>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.[/color]
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. http://wordpress.org/
Trevor | | | | re: Can php do this?
Trevor Smith wrote:[color=blue]
> On 19 Jul 2004 12:20:05 -0700, kurdayon@yahoo.com (Kurda Yon) wrote:
>[color=green]
>> Hi,
>>
>> 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.[/color]
>
> 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.
> http://wordpress.org/
>
> Trevor[/color]
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.
Pjotr | | | | re: Can php do this?
By Mon, 19 Jul 2004 20:38:10 GMT, Westcoast Sheri
<sheri_deb88@nospamun8nospam.com>
decided to post "Re: Can php do this?" to
comp.lang.php:
[color=blue]
>Artoo wrote:
>[color=green]
>> Kurda Yon a exposé le 19/07/2004 :[color=darkred]
>> > Hi,
>> >
>> > 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.[/color]
>>
>> 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.[/color]
>
>Question: you say, "store the stories in files..."
>Well, what are your thoughts about storing the stories in a mySQL database?[/color]
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:
#!/bin/bash
## 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 -- |  | | | | /bytes/about
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 226,295 network members.
|