 |
01-09-2004, 08:21 PM
|
#1 (permalink)
|
|
JohnScott's Lovechild
Join Date: 10-12-03
Posts: 9,994
Latest Blog: None
|
Quote Script
I'm going to have a quote section on my new website, and I'm in search of a reliabe, free, and sturdy script for it. I would prefer it be written in php/mySQL and easily customizable, but if it is written in perl I'll live.
Any suggestions?
|
|
|
01-09-2004, 08:23 PM
|
#2 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
|
kind of like www.bash.org?
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
01-09-2004, 08:24 PM
|
#3 (permalink)
|
|
JohnScott's Lovechild
Join Date: 10-12-03
Posts: 9,994
Latest Blog: None
|
Nope. Kind of like another column. It just displays a random quote, calling it from the database, and I can place the quote anywhere on the site.
|
|
|
01-09-2004, 08:32 PM
|
#4 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
|
mmhh
mysql table needs to have 1 column.. quote
mysql.php:
[code:1:6405d18239]<?php
mysql_connect("host", "user", "pass");
mysql_select_db("db");
?>[/code:1:6405d18239]
quote.php:
[code:1:6405d18239]<?php
include("mysql.php");
$query = "SELECT quote FROM table";
$result = mysql_query($query) or die(mysql_error());
$num = mysql_affected_rows();
$rand = rand(1,$num);
$query = "SELECT quote FROM table LIMIT '$rand', '$rand'";
$result = mysql_query($query) or die(mysql_error());
while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$quote = $line['quote'];
}?>[/code:1:6405d18239]
index.php or wherever you want to call it from
[code:1:6405d18239]<?php include("quote.php"); ?> and whereever you want to display quote: <?php echo $quote; ?>[/code:1:6405d18239]
want an addquote.php too?
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
01-09-2004, 09:00 PM
|
#5 (permalink)
|
|
JohnScott's Lovechild
Join Date: 10-12-03
Posts: 9,994
Latest Blog: None
|
Sure! Thanks Spear 
|
|
|
01-09-2004, 10:09 PM
|
#6 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
|
addquote.php
[code:1:4a857e22c7]<?php
include("mysql.php");
if (isset($_POST['quote'])) {
$quote = $_POST['quote'];
$query = "INSERT INTO table (quote) VALUES('$quote')";
$result = mysql_query($query) or die(mysql_error());
echo "Quote added.";
} else {
echo "<form method="POST" action="addquote.php"><input name="quote"><input type="submit"></form";
}
?>[/code:1:4a857e22c7]
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
01-09-2004, 10:10 PM
|
#7 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
|
Backlinks are always appreciated yum.
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
01-10-2004, 05:07 AM
|
#8 (permalink)
|
|
Contributing Member
Join Date: 10-13-03
Posts: 4,106
Latest Blog: None
|
nice script spear
|
|
|
01-10-2004, 09:49 AM
|
#9 (permalink)
|
|
JohnScott's Lovechild
Join Date: 10-12-03
Posts: 9,994
Latest Blog: None
|
Thanks spear  You'll get a link on my links page when I get the site up 
|
|
|
01-10-2004, 10:15 AM
|
#10 (permalink)
|
|
Possible Terrorist
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,905
|
yummy.
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
|
|
|
01-10-2004, 10:30 AM
|
#11 (permalink)
|
|
Contributing Member
Join Date: 10-13-03
Posts: 4,106
Latest Blog: None
|
Hehe lol
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:39 AM.
© Copyright 2008 V7 Inc
|
|