HTML - Random Question Generation?
Maybe someone here can shed some light on this for me. I am trying to create a site which displays 12 random questions from a pool of a few hundred. A visitor will come to the site, answer the questions and see the results, much like a poll but they will be randomly generated. I am lost as to where to start on this. I tried a poll type approach but that was not the answer. Those were fixed questions and the polls were powered by other sites. Anyone have ideas or tips on how I can start on this?
Similar TutorialsI'm writing a web application designed to be viewed on Windows Mobile phones for my work. It contains proprietary information so I am unable to share the link. I have a contact form, and I want a code that when clicked, will open up the SMS application on the phone and populate the recipient automatically. Can it be done? a while back i decided to create a database to index my entire music collection. i did the whole thing entirely in html with the exception of a little css and javascript for style. ive gotten every little detail of every little code fully customized to my liking. my new challenge is to find a way to generate my own style of coding with some sort of code generator. i was wondering if anyone knew of a way i could go about this. what i do now is i have a text list of the songs to add to a page and i use the Find/Replace function of notepad to replace the placeholders within my code. my entire pages are all coded with variables like "AlbumName", "Track-3" and "BandName" so that i can easily Find/Replace those terms with the bands, albums or songs that go in their place. i'll include some of the code in this message. what im trying to do is find either a piece of software or a webpage with a form that i can customize to generate these chunks of codes for me...so that i dont have to Find/Replace each and every song manually. i want to either generate the code from a simple text list of the names OR be able to type in the song names into a form of some sort and click Generate! and have it generate the chunk of code for an entire album at a time...so i can copy and paste it into the html file...not having to do as much work. here's a sample of one album's code (if i add this in the right place on a band's page and place the files in the correct folder, the album is added to the database and i can click on any song or album name to play a single song or playlist in winamp). this is an album called Lapalco by Brendan Benson: Code: <table> <tr> <td valign=top> <a name="Lapalco"> <img src="Lapalco/cover.jpg"></a> </td> <td width=10> </td> <td valign=top> <font size=5> <a href="Lapalco/Lapalco.m3u" style="text-decoration: none"> Lapalco</a> <font size=2> <br><br> 1. <a href="Lapalco/Tiny Spark.mp3" style="text-decoration: none"> Tiny Spark</a><br> 2. <a href="Lapalco/Metarie.mp3" style="text-decoration: none"> Metarie</a><br> 3. <a href="Lapalco/Folk Singer.mp3" style="text-decoration: none"> Folk Singer</a><br> 4. <a href="Lapalco/Life In the D.mp3" style="text-decoration: none"> Life In the D</a><br> 5. <a href="Lapalco/Good to Me.mp3" style="text-decoration: none"> Good to Me</a><br> 6. <a href="Lapalco/You're Quiet.mp3" style="text-decoration: none"> You're Quiet</a><br> 7. <a href="Lapalco/What.mp3" style="text-decoration: none"> What</a><br> 8. <a href="Lapalco/Eventually.mp3" style="text-decoration: none"> Eventually</a><br> 9. <a href="Lapalco/I'm Easy.mp3" style="text-decoration: none"> I'm Easy</a><br> 10. <a href="Lapalco/Pleasure Seeker.mp3" style="text-decoration: none"> Pleasure Seeker</a><br> 11. <a href="Lapalco/Just Like Me.mp3" style="text-decoration: none"> Just Like Me</a><br> 12. <a href="Lapalco/Jet Lag.mp3" style="text-decoration: none"> Jet Lag</a> </td> </tr> </table> so thats the format i use for everything...even though some albums require more customization which never takes too long. here's what it would be like in my generic placeholder code: Lapalco would be AlbumName Tiny Spark would be Track1 in both places you see it i guess i should show the original code too: Code: <table> <tr> <td valign=top> <a name="AlbumName"> <img src="AlbumName/cover.jpg"></a> </td> <td width=10> </td> <td valign=top> <font size=5> <a href="AlbumName/AlbumName.m3u" style="text-decoration: none"> AlbumName</a> <font size=2> <br><br> 1. <a href="AlbumName/Track1.mp3" style="text-decoration: none"> Track1</a><br> 2. <a href="AlbumName/Track2.mp3" style="text-decoration: none"> Track2</a><br> 3. <a href="AlbumName/Track3.mp3" style="text-decoration: none"> Track3</a><br> 4. <a href="AlbumName/Track4.mp3" style="text-decoration: none"> Track4</a><br> 5. <a href="AlbumName/Track5.mp3" style="text-decoration: none"> Track5</a><br> 6. <a href="AlbumName/Track6.mp3" style="text-decoration: none"> Track6</a><br> 7. <a href="AlbumName/Track7.mp3" style="text-decoration: none"> Track7</a><br> 8. <a href="AlbumName/Track8.mp3" style="text-decoration: none"> Track8</a><br> 9. <a href="AlbumName/Track9.mp3" style="text-decoration: none"> Track9</a><br> 10. <a href="AlbumName/Track-10.mp3" style="text-decoration: none"> Track-10</a><br> 11. <a href="AlbumName/Track-11.mp3" style="text-decoration: none"> Track-11</a><br> 12. <a href="AlbumName/Track-12.mp3" style="text-decoration: none"> Track-12</a> </td> </tr> </table> so im looking for a better way to replace those variables than to use Find/Replace in notepad. i only use notepad for editing. i only know html. i dont want to use any new kinds of coding in my database. id only be willing to use code i can customize and only for the generator which wouldnt be connected to the database. i know most people would just use php to generate these entire pages but im very particular about my coding. please let me know if you have any suggestions about how i can achieve this or if you have any questions about how i do things or how i want to go about this. and im sorry for the long post. thank you. on the mainpage of my site, i have a enter button, however I have 4 different sites. I want when you click enter, it brings you to 1 of the 4 at random each time... how would i go about that? thanksss. its much appreciated to whoever trys or can help. I have this code below, and i would like it to randomly place 2 X's in any of the boxes, and each time i refresh the page the X's could end up in any of them, any idea how to do it? Thanks Dr Ben HTML Code: <html> <head><title></title></head> <body> <form name="placeships" action="board.php" method="post"> <table> <tr> <td align="center" bgcolor="black"><input type="text" id="1" class="hide" name="1" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="2" class="hide" name="2" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="3" class="hide" name="3" value="" size="2"> </td> <td align="center" bgcolor="black"><input type="text" id="4" class="hide" name="4" value="" size="2"> </td> </tr> <tr> </tr> <input value="submit" name="submit" type="submit"> </form> </body> </html> Hello everyone. Sorry for appearing to be another person to register with "vitally important question" and then probably never be seen again, but I think I'll be using this site to learn as much as I can about HTML. Anyway, my question is about HTML, but not for a website. It's for an iPhone widget. I don't want to advertise for any other forums or anything, but there is currently a tweak in development that allows for windows phone 7 live tiles on an iPhone. They use HTML code and as you can tell, I'm not a coder. There is a slideshow widget available that displays a random picture from a set location. I'm very new to HTML, but I have figured out quite a bit by changing a value and having a look at what it did. There is one thing that has me completely stumped though and this is what I would like to know. In the following code, it has the [Math.floor(math.random() bit. I've tried to add a 1 in the brackets, I've tried changin the random to no and false, I've tried just removing the line and I still can't get it. <html> <head> <meta name="viewport" content="width=238, user-scalable=no" /> <script> window.onload = onLoad; var array = "101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124".sp lit("|"); function onLoad(){ document.getElementById("show").src = array[Math.floor(Math.random()*array.length)] + ".png"; setTimeout(onLoad,1*200); } </script> </head> <body> <img src = "overlay.png" style = "position:absolute;top:0px;left:0px;z-index:1;"/> <img id ="show" style="position:absolute;top:-0px;left:0px;width:238px" /> </body> </html> What I want is for it to cycle through all the images in order. Any help would be greatly appreciated. THanks. Hey there! Is it possible to have a random GIF file loaded each time you open the site? For example if you open the page now, an animated GIF will load to advertise x and when you go to the same page later, an ad will load to advertise y. Thanks in advance! I Say I have 10+ 468x60 banners I was wondering if there is anyway of having them show up randomly in one spot when you refresh the page. For example here is an ad I'm using: <script type="text/javascript" language="javascript" src="http://www.tkqlhce.com/placeholder-2762512?target=_blank&mouseover=N"></script> I know there is a way to random images but how do you randomize scripts? Hi there, I have created a site that can be viewed at www.prestigeinteractive.com/legacy2 On this site I have utilized a basic two column design with both a header and a footer. You may need to look at the first page to know what i am talking about. Upon creating the site I wanted to make the athletes on the page extend beyond the borders of the site's wrapper. In order to do that and maintain reasonable filesizes, I opted to splice the images. I used a jpeg for the large part within the wrapper, and used a png in a absolute positioned div for the parts that are to extend beyond the site's wrapper/container (needed a transparent image to display the border and site's background properly). The friend I am making the site for asked if I could set it up so that there can be a number of images that randomly load when a user enters the home page. I am not sure it that is possible using the format I've implemented (2 images properly aligned). Can this be done? I've done it before with single images within a div tag, but not two that need specific coordinates to appear aligned correctly. If "yes this can be done", could someone kindly point me in the right direction to find a tutorial on this. If not, I'd appreciate knowing this as well, as I'll need to come up with an alternative plan. Thank you for your time, G How would i show a random image? When people come onto my site, i want the header to be random out of about, 6 different ones. When you refresh the page, it changes the image. (for more explaingin, ha) How would i go about doing this? Hello everyone! I have this client who has a lot of resellers, and all of them are on a list in his website, so that when customers look for someone to buy from, they can choose through his site. However, he is afraid that if the list is static, no one will bother to look beyond the first 2 or 3 names, and the ones in the bottom of the list will never be contacted. So, I need to create a method to display the resellers list in such a way that everytime one accesses the list, the order is changed at random, but always displaying all the names. The HTML code the names are arranged right now is a simple table with one reseller per TR tag. I don't work with MySQL, so the solution should be something else... PHP or Java preferred. Thanks in advance! Okay... Here is what I'm trying to do...and not really sure as an HTML novice where to even start. I have something called a 'blogwall' on my site, it's url is he http://www.weusecoupons.com/index.php?pageid=blogroll What I would like to do, is on the main page: www.weusecoupons.com Have a ONE of the 125x125 buttons appear randomly. Is this a simple thing? All images are hosted locally!! Thanks for your help. I tried using the search function, but I don't know if it's my browser or what but it won't finish loading the results page. Is there a way in HTML, to create a link that can go to two possible pages, but when you click it, it randomly goes to either one? Thanks, Jon I want to create a lotto system on my vbulletin forum..I have designed .gif graphics for each ball 1-49. I need a script ( whether java or html ) to randomly select 6 numbers without selecting the same number twice...I have saved the balls as smilies, so need the results to show lb1 lb2 lb3 etc... I hope you understand what I mean... Any help would be very much appreciated I am an Admin for a PC gaming clan ( |ESF| ), and we have several game servers. Our goal is to have a random "server of the day" widget on the main page of the site. Here is what we need it to do: > Show the same server for all visitors to the page > Show the same server for a 24 hour period, say from 12am - 11:59pm > Have the code editable in case we change/add/remove a server I have some experience in Vb6 and Vb.Net, but not much HTML. I would assume the code would be something similar to: Dim SOTD As New String (Server of the Day) "Server List" Dim s1 As New String (Server 1) Dim s2 As New String (Server 2) Dim s3 As New String (Server 3) If TimeOfDay Is 12:00am Then Show SOTD(Random Server from List) Until TimeOfDay Is 11:59pm End If I know that isn't close to HTML, but it should help get the overall point across. Any help to get us closer to this goal is MUCH appreciated. If I wasn't specific enough with the above information, please let me know what else you need to know. It's very late and I'm super tired. Thank you in advance. Hello, I'm sure the subject about random generators must have been asked a billion times before, but I can't seem to find an answer for my set up. Basically I have a style.css sheet which defines some images like this: #gallery .pic01 { background: url('images/gallery_images/pic_01.jpg') no-repeat; width: 205px Then in my html I have a list of these images like this <div id="gallery"> <ul> <li class="pic01"></li> <li class="pic02"></li> <li class="pic03"></li> </ul> What I'd like to do is have the pictures choosen randomly so that each time the page loads you get a different set of pictures. Is this possible. Please forgive me if this is easy peasy to do - I'm a real html thicky! I used this code here but it doesnt seem to work for GoogleChrome browser well, as it did for the others. Is there a code that will work for all the browsers? HTML Code: <html> <head> <script language="javascript"> function randomBackground() { var myImages = Array(); myImages[0] = 'xxx.jpg'; myImages[1] = 'xxx.jpg'; myRandomNumber = Math.floor(Math.random()*myImages.length); document.body.style.backgroundImage = 'URL('+myImages[myRandomNumber]+')'; } </script> <style type="text/css"> body { background-attachment: fixed; background-repeat: no-repeat; } </style> </head> <body onload="randomBackground();"></body> Hey all. Can anyone help? I want to make a feature of my site that if you follow a broken link or navigate to a page that doesnt exist, you will get one of 3 different 404 pages. My hosting allows for one catch - all error page, but I was wondering if theres a function in html that redirects immediately to aother page. Thanks in advance Hello, I am trying to design a very simple HTML game, but there are some fundamental questions which I need to resolve before I know where I need to start. I was wondering if its possible to use just HTML (running on an old computer (pentium 3 or 4) on linux) to execute commands like, loading up a random page, loading a page after a count down timer is up, loading a page when any key is pressed and being able to turn these commands on and off according to eachother.. You might be able to tell from this that I am not very experienced at all with this sort of thing.. an example: A web page is showing, the user presses any key, a random page is loaded, a countdown timer starts, the user either presses a specific key or the time runs out, the result is a new web page loading depending on the amount of time that has expired on the countdown timer, a new coundown timer starts, when it runs out the original start webpage is loaded and the loop can go on. I would really appreciate any help on this. Hey guys, Ive seen this done a few times but, how would I go about having a random flash video intro page. i.e. Everytime the user refreshes the page a different flash movie appears (chosen randomly from a folder). Thanks! |