Results 1 to 8 of 8

Thread: parse error, unexpected T_VARIABLE..

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Dallas, Texas
    Posts
    62

    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

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    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
    	}
        }
    		 
    		
    ?>
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    also

    for($x=0;$x=7;$X++) {


    should be

    for($x=0;$x=7;$x++) {


    watch you cases, $x is different than $X

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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;?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    hehe, I missed that one

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by phpman
    hehe, I missed that one
    I thought it might be some way cool programming concept I didn't know about
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    Member
    Join Date
    Nov 2002
    Location
    Dallas, Texas
    Posts
    62
    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

  8. #8
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    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
  •  



Click Here to Expand Forum to Full Width