Forum Moderators: coopster

Message Too Old, No Replies

Quote of the day type website

quotes, dynamic, refresh

         

Tacklephile

8:40 pm on Mar 31, 2005 (gmt 0)

10+ Year Member



I'm trying to make a "quote of the day" type website and I'm assuming that having the quotes in MySQL and pulling them out with php is the way to go.

My questions is, is there any templates or scripts out there that have it set up so that a new quote will be displayed at each visit, and also that has a function that will allow people to add quotes?

Any help would be greatly appreciated. Thanks!

mcibor

11:05 am on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome Tacklephile to webmasterworld! I recommend using google first:
[google.com...]
There are lots of such scripts, however none of them use automatic writing to database by anybody. I myself wouldn't recommend it, as people are sometimes rude.

However there are many tutorials how to write to db on form submit, therefore it shouldn't be a problem to merge these two scripts.

mcibor

11:06 am on Apr 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it would be sth like:
<form action="write.php" method="POST">
author: <input type="text" name="author">
text: <textarea name="text"></textarea>
<input type="submit" name="action" value="New Quote">
</form>

in write.php:

<?php
if($_POST["action"] == "New Quote")
{
//mysql_connect...
$author = mysql_escape_string($_POST["author"]);
$text = mysql_escape_string($_POST["text"]);
mysql_querry("INSERT INTO quotes(author, text) VALUES('$author','$text')");
}
?>

Hope this helps!
Best regards
Michal Cibor

PS Sorry for 2 messages but I seem to have a problem submitting one long message on this forum.