Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Quote randomiser - generator

    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!

  • #2
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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.

  • Users who have thanked teedoff for this post:

    imagxinary (10-30-2010)

  • #3
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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/ran...otes-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.
    Last edited by imagxinary; 10-30-2010 at 12:28 AM.

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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. 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 that gives the code for this.
    Last edited by teedoff; 10-30-2010 at 12:33 AM.

  • Users who have thanked teedoff for this post:

    imagxinary (10-30-2010)

  • #5
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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. :/
    Last edited by imagxinary; 10-30-2010 at 12:35 AM.

  • #6
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,338
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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).

  • Users who have thanked teedoff for this post:

    imagxinary (10-30-2010)

  • #7
    New to the CF scene
    Join Date
    Oct 2010
    Posts
    4
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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. :/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •