View Full Version : Quote randomiser - generator

Oct 30th, 2010, 12:10 AM
Hi, Im Melanie and new to this site and some things. I joined just to ask on here of how to make something. I know very little of anything javascript, but I know some html and thats about all...

What Im trying to basically see if I can do is create something where a user can click a button, and random quotes - or words can be displayed either normally or in a form. Is there any way to do that HTML wise? The site Im using to post it on is that of a journal [kinda like LiveJournal], and does not accept Javascript, but uses HTML and CSS.

Hopefully someone can help, thanks in advance!

Oct 30th, 2010, 12:16 AM
Its very possible with server side languages such as Coldfusion or PHP. You would need the quotes to be stored in a database and called by the use of queries once the user clicks the button.

Why not google it. I just did and think I saw a site using PHP to do this here (http://www.quotationspage.com/random.php3).

Oct 30th, 2010, 12:23 AM
I think I get that. Ive never used PHP either, so Im kinda confused but found a site that may help, unless you have suggestions?

[What I found: http://www.3till7.net/2005/06/08/random-quotes-with-php/ ]

So, from what Im reading, does it mean I basically have to make a text file of the quotes and such and then load that somewhere, and basically link back via the code? Im so confused and I apologise that I dont know all that much of anything so cant be much help. :(

Im just unsure as well as to what things will work on the journal.

Oct 30th, 2010, 12:28 AM
If I understand you right...you just want a bunch of different quote that are randomly displayed when I user clicks on a button.

No not a text file. A database would hold the quotes in a table. Then a query would call the random quote based on the user clicking a button. This could also be done simply on each page load or refresh.

CHeck out dynamic drive (http://www.dynamicdrive.com). I think they have a few, not sure of they aren't javascript based though.

Ok I googled and think now you dont HAVE to use a database. It would make managing the quotes much easier, but you could use an array and call them using php,

I found this site (http://www.davidmarotz.com/quotes.php)that gives the code for this.

Oct 30th, 2010, 12:33 AM
Yep, thats what I do want. I will look there, thank you! Im sure Ill find something and if I dont, I guess I dont. Its not a dier need or anything, but helps to learn new stuff like this anyway! :]

So just post the code in or? Sorry, Im extremely new and unsure what is what. :/

Oct 30th, 2010, 12:39 AM
well no not exactly. SInce its php script, you would need to save the html file with .php extension instead of .html extension. You would also need a php server to "serve" the php code

Is this a site you have hosted somewhere already? If so check to make sure they support PHP(most do).

Oct 30th, 2010, 12:43 AM
Ohhh! I think I understand, Im slow today, sorry again. Im trying to understand it all.

I dont host the journal, I just have a journal on the site. Its kinda like LiveJournal. I dont think I can as Im just a user, but wasnt sure if this type of thing was possible at all. :/