SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 3rd, 2002, 07:57 AM
cemlouis cemlouis is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 49 cemlouis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
How to generate a 20 random word including 10 characters???

I made a thing like that but it is not working:

<?php
for($xl=0;$xl<20;$xl++){
$a="";$a="";
function doit() {
while ($i<10) {
$i++;
$determine = mt_rand(1,61);
if ($determine==1) {$a.="1";}
if ($determine==2) {$a.="2";}
if ($determine==3) {$a.="3";}
if ($determine==4) {$a.="4";}
if ($determine==5) {$a.="5";}
if ($determine==6) {$a.="6";}
if ($determine==7) {$a.="7";}
if ($determine==8) {$a.="8";}
if ($determine==9) {$a.="9";}
if ($determine==10) {$a.="a";}
if ($determine==11) {$a.="b";}
if ($determine==12) {$a.="c";}
if ($determine==13) {$a.="d";}
if ($determine==14) {$a.="e";}
if ($determine==15) {$a.="f";}
if ($determine==16) {$a.="g";}
if ($determine==17) {$a.="h";}
if ($determine==18) {$a.="i";}
if ($determine==19) {$a.="j";}
if ($determine==20) {$a.="k";}
if ($determine==21) {$a.="l";}
if ($determine==22) {$a.="m";}
if ($determine==23) {$a.="n";}
if ($determine==24) {$a.="o";}
if ($determine==25) {$a.="p";}
if ($determine==26) {$a.="q";}
if ($determine==27) {$a.="r";}
if ($determine==28) {$a.="s";}
if ($determine==29) {$a.="t";}
if ($determine==30) {$a.="u";}
if ($determine==31) {$a.="v";}
if ($determine==32) {$a.="w";}
if ($determine==33) {$a.="x";}
if ($determine==34) {$a.="y";}
if ($determine==35) {$a.="z";}
if ($determine==36) {$a.="A";}
if ($determine==37) {$a.="B";}
if ($determine==38) {$a.="C";}
if ($determine==39) {$a.="D";}
if ($determine==40) {$a.="E";}
if ($determine==41) {$a.="F";}
if ($determine==42) {$a.="G";}
if ($determine==43) {$a.="H";}
if ($determine==44) {$a.="I";}
if ($determine==45) {$a.="J";}
if ($determine==46) {$a.="K";}
if ($determine==47) {$a.="L";}
if ($determine==48) {$a.="M";}
if ($determine==49) {$a.="N";}
if ($determine==50) {$a.="O";}
if ($determine==51) {$a.="P";}
if ($determine==52) {$a.="Q";}
if ($determine==53) {$a.="R";}
if ($determine==54) {$a.="S";}
if ($determine==55) {$a.="T";}
if ($determine==56) {$a.="U";}
if ($determine==57) {$a.="V";}
if ($determine==58) {$a.="W";}
if ($determine==59) {$a.="X";}
if ($determine==60) {$a.="Y";}
if ($determine==61) {$a.="Z";}
}
return $a;

$b=doit();
echo $b;
}

}
?>

Reply With Quote
  #2  
Old October 3rd, 2002, 05:15 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
i dont think that you can define a function inside a for statement!

Reply With Quote
  #3  
Old October 6th, 2002, 11:29 PM
Adman Adman is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 5 Adman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
you can the first time, but then each time after that it will give you an error saying function already defined or something.

Reply With Quote
  #4  
Old October 7th, 2002, 01:32 PM
sschmuck sschmuck is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Brooklyn,NY
Posts: 4 sschmuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sschmuck Send a message via AIM to sschmuck Send a message via Yahoo to sschmuck
dude, u have to learn about switch asap

Reply With Quote
  #5  
Old October 7th, 2002, 01:33 PM
sschmuck sschmuck is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Brooklyn,NY
Posts: 4 sschmuck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sschmuck Send a message via AIM to sschmuck Send a message via Yahoo to sschmuck
there's a tutorial on password generation at phpbuilder.com - give it a shot.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > How to generate a 20 random word including 10 characters???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway