473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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.
Jul 17 '05 #1
9 1930
Kurda Yon a exposé le 19/07/2004 :
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.


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

Jul 17 '05 #2
Kurda Yon wrote:

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?


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 - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #3
Kurda Yon wrote:
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?


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. |
Jul 17 '05 #4
Artoo wrote:
Kurda Yon a exposé le 19/07/2004 :
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.


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.


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

Jul 17 '05 #5
Westcoast Sheri wrote:
Artoo wrote:
Kurda Yon a exposé le 19/07/2004 :
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.


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.


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


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
Jul 17 '05 #6
On 19 Jul 2004 12:20:05 -0700, ku******@yahoo.com (Kurda Yon) pecked
out:
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.


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
Jul 17 '05 #7
On 19 Jul 2004 12:20:05 -0700, ku******@yahoo.com (Kurda Yon) wrote:
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.


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
Jul 17 '05 #8
Trevor Smith wrote:
On 19 Jul 2004 12:20:05 -0700, ku******@yahoo.com (Kurda Yon) wrote:
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.


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


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
Jul 17 '05 #9
/..
By Mon, 19 Jul 2004 20:38:10 GMT, Westcoast Sheri
<sh*********@nospamun8nospam.com>
decided to post "Re: Can php do this?" to
comp.lang.php:
Artoo wrote:
Kurda Yon a exposé le 19/07/2004 :
> 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.


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.


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


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 --
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
I have a from with 2 fields: Company & Name Depening which is completed, one of the following queries will be run: if($Company){ $query = "Select C* From tblsample Where ID = $Company...
5
by: Scott D | last post by:
I am trying to check and see if a field is posted or not, if not posted then assign $location which is a session variable to $location_other. If it is posted then just assign it to...
2
by: Nick | last post by:
Can someone please tell me how to access elements from a multiple selection list? From what ive read on other posts, this is correct. I keep getting an "Undefined variable" error though... Form...
2
by: Alexander Ross | last post by:
I have a variable ($x) that can have 50 different (string) values. I want to check for 7 of those values and do something based on it ... as I see it I have 2 options: 1) if (($x=="one") ||...
0
by: Dan Foley | last post by:
This script runs fine, but I'd like to know why it's so slow.. Thanks for any help out there on how i can make it faster (it might take up to 5 min to write these 3 export files whith 15 records...
5
by: Lee Redeem | last post by:
Hi there I've created abd uploaded this basic PHP script: <html> <head> <title>PHP Test</title> </head> <body> <H1 align="center">
5
by: christopher vogt | last post by:
Hi, i'm wondering if there is something like $this-> to call a method inside another method of the same class without using the classname in front. I actually use class TEST { function...
6
by: Phil Powell | last post by:
Ok guys, here we go again! SELECT s.nnet_produkt_storrelse_navn FROM nnet_produkt_storrelse s, nnet_produkt_varegruppe v, nnet_storrelse_varegruppe_assoc sv, nnet_produkt p WHERE...
1
by: Michel | last post by:
a site like this http://www.dvdzone2.com/dvd Can you make it in PHP and MySQL within 6 weeks? If so, send me your price 2 a r a (at) p a n d o r a . b e
11
by: Maciej Nadolski | last post by:
Hi! I can`t understand what php wants from me:( So: Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.