PDA

View Full Version : Questions about the random numbers script



webdesignee
04-13-2006, 05:02 PM
Heres a question about something I have seen alot when registering for the first time on a new site.

How hard is it to write? If I have the pictures of the numbers on file could this file be substituted in it ?

thanks,
John

jscheuer1
04-13-2006, 06:58 PM
Probably. But, what are you talking about exactly? Where is this script?

Twey
04-13-2006, 07:12 PM
Do you mean the bot check scripts that say "type the numbers shown in the image below?" If so, this isn't Javascript; it would have to be done with a server-side language with graphics-manipulation support.

webdesignee
04-13-2006, 07:32 PM
When you register for a new site and it ask you to enter a number combination or a letter number combination exactly as it is. The numbers or letters are the varibles and they can change randomly from time to time. Its an assignment for my jscript class and I was wanting to get some ideas about it before attemping it.

thanks,
John

Twey
04-13-2006, 08:27 PM
Yes, I know what you're talking about. But your professor, apparently, doesn't. Doing this in Javascript would defeat the point. It tends to be a script on the server that generates an image containing the numbers or letters.

webdesignee
04-14-2006, 03:37 AM
Now I am really confused she gave us the site files to write the script into and the pictures / graphics if its not javascript then what are we working with or trying to write?

thanks
John

jscheuer1
04-14-2006, 03:55 AM
If you have no script as a jumping off point (even a random number generator would do) and no layout that you want the script to power, you are not only up a creek with no paddle, you don't even have a creek. :)

My suggestion would be to find some kind of random number generator or array shuffling routine and to set up a layout that at least looks like what you want even if it doesn't yet do what you want. Then take your best shot at making it work.

If you need help at that point, that's what we are here for. Designing your project from scratch with just a vague idea of what it is about is not something we generally go in for around here.

Twey's observations that this sort of thing would be best done server side sound right on to me except that, as an exercise in javascript, for a class, using javascript for this would seem acceptable. It would not be good for preventing robots from signing up repeatedly to spam a real website or to host valid users who happen to have javascript either disabled or unavailable.

If the assignment was to use javascript, I'd go for it. For extra credit you might want to research why javascript is not the best method for this and perhaps even devise a PHP or asp version. But, knowing teachers and students in general, if the assignment is javascript, use javascript.

djr33
04-14-2006, 06:03 AM
JS is a bad idea 'cause the bots could just read the JS that verifies it... like giving a class a test with a copy of the key attached...
Use if you must, though.

To add to the ideas above--
start with a set of like 10 images. Then you don't have to worry about generating images... JS can't do that. Those 10 images would then have codes or something, and matching "correct" text entries.... it would fool the bots because, unless someone checked your site out a bunch, they'd just assume it to be random... not that you only have 10 choices.
But... random isn't too hard... just making the images and corresponding keys... that's kinda hard.


You don't have to answer this here, but I'm just kinda wondering. Are you doing well in your class? I mean... shouldn't the teacher be teaching this stuff? If you're not doing so well, then it makes more sense (about the teacher)... but... yeah.
I don't mean to sound like I'm accusing you of something... just wondering... I mean, if I were to take a class, I'd hope that I wouldn't have to go outside the class to get ideas for these things... hope that the teacher would be a valuable resource.
//off topic...

Twey
04-14-2006, 12:50 PM
I don't mean to sound like I'm accusing you of something... just wondering... I mean, if I were to take a class, I'd hope that I wouldn't have to go outside the class to get ideas for these things... hope that the teacher would be a valuable resource.People are more likely to remember things they have to take time to find out themselves. This is why tests and little assignments like this are so frequently used in educational institutions.

webdesignee
04-14-2006, 11:50 PM
I have messed with javascript before this class mainly with jims menu 5.7 I am not an expert there still things I need to learn. To me debugging can be fun .

thanks,
John

djr33
04-15-2006, 02:09 AM
Twey, you're right... I'm just curious as to why the class doesn't have a textbook to answer this kind of thing... but... yeah... different learning style. That's true. Anyway, back on topic--

how's it going, John? Any of our ideas helpful?

jscheuer1
04-15-2006, 02:13 AM
Twey, you're right... I'm just curious as to why the class doesn't have a textbook to answer this kind of thing... but... yeah... different learning style. That's true. Anyway, back on topic--

how's it going, John? Any of our ideas helpful?

How do you know the answer isn't in the textbook? The answer most certainly is on the web though so, in a computer class, I would think fostering the ability to use a search engine is a good thing (apologies to M. Stewart).

djr33
04-15-2006, 04:06 AM
I'm assuming if he's asking here that it isn't in the text book... I dunno.
Anyway, I'm in a web design class... just kinda skipping ahead a bunch with what I'm doing... they're happily learning about tables or some such right now... so... yeah, I can see why someone's on here asking for help with a class... just thought it was worth asking... more out of curiosity than anything else.
Sorry for dragging it off topic :)

jscheuer1
04-15-2006, 06:01 AM
I'm assuming if he's asking here that it isn't in the text book... I dunno.

The one doesn't necessarily follow from the other. Some folks are just lazy. I have no idea in this case, it just strikes me as odd that the OP apparently did no work on this first, instead coming directly here for help.

djr33
04-15-2006, 10:17 AM
I was just giving him the benefit of the doubt... seems like a nice enough guy :)

webdesignee
04-17-2006, 10:02 PM
All of your ideas have been very helpful.

thanks,
John