|
-
Apr 24th, 2003, 03:32 PM
#1
Thread Starter
Member
parse error, unexpected T_VARIABLE..
Code:
<?
function RandomPass($thelen) {
srand(date("s"));
$garbage="abcdefghijklmnopqrstuvwxyz";
$thepass="daniel"
$pass="";
while ($pass<>$thepass) {
for($x=0;$x=7;$X++) {
$pass .= substr($garbage,(rand()%(strlen($garbage))),1);
}
echo $pass
}
}
?>
i am getting that T_VARIABLE error on line 6 and when i take it out i get a T_WHILE error on line 6.. what does this mean and how do i fix it?
oOBlackOrbOo
-
Apr 24th, 2003, 03:36 PM
#2
Code:
<?
function RandomPass($thelen) {
srand(date("s"));
$garbage="abcdefghijklmnopqrstuvwxyz";
$thepass="daniel"; //Missing the ";" here... classic mistake, easy to miss... been there a LOT of times.
$pass="";
while ($pass<>$thepass) {
for($x=0;$x=7;$X++) {
$pass .= substr($garbage,(rand()%(strlen($garbage))),1);
}
echo $pass
}
}
?>
-
Apr 24th, 2003, 04:19 PM
#3
Frenzied Member
also
for($x=0;$x=7;$X++) {
should be
for($x=0;$x=7;$x++) {
watch you cases, $x is different than $X
-
Apr 24th, 2003, 04:56 PM
#4
Stuck in the 80s
Originally posted by phpman
also
for($x=0;$x=7;$X++) {
should be
for($x=0;$x=7;$x++) {
watch you cases, $x is different than $X
What is this loop supposed to do? $x=0;$x=7; ??
Is it supposed to be $x<7;?
-
Apr 24th, 2003, 05:11 PM
#5
Frenzied Member
hehe, I missed that one
-
Apr 24th, 2003, 05:13 PM
#6
Stuck in the 80s
Originally posted by phpman
hehe, I missed that one
I thought it might be some way cool programming concept I didn't know about
-
Apr 25th, 2003, 06:48 AM
#7
Thread Starter
Member
thanks for all the help guys , can anyone give me a site with some good basic source code for php that i can work off of, i am not very good with tutorials and i would rather work off of previously written source to learn new stuff and make new programs but i cant find any stuff with BASIC things,all of the programs i found were extremly complicated and hard to understand. I wrote this program from bits and a peices of another program that i found but that was the only one that i understood.. any help would be appreciated
oOBlackOrbOo
-
Apr 25th, 2003, 09:38 AM
#8
Frenzied Member
www.snippetlibrary.com
not sure where you plan on getting source for php pages? not like anybody is going to say, yeah here is teh code for my pages, copy it and us it.
tutorials are your only hope, besides the manual
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|