RE: [PHP] function and global problems

From: Date: Fri, 06 Apr 2001 06:24:40 +0000
Subject: RE: [PHP] function and global problems
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47412@lists.php.net to get a copy of this message
I don't have to wait tell tomorrow I feel funny already Thanks Richard > Look at the line directly above where you're parse error is. > > It semi-lacks part of the lower intentestional tract. > > > That will seem funny to you tommarrow. > > > -- > Plutarck > Should be working on something... > ...but forgot what it was. > > PS: No it won't. > > ""Richard Kurth"" <rkurth@pacifier.com> wrote in message > news:FGEPLIKKFNGPGLDMFDCLCENBDCAA.rkurth@pacifier.com... > > I can not seem to get this figuered out I whant to run this function to > pull > > data out of a file and thin use the data in the rest of the > program. When > I > > do this I get a Parse error: parse error in > > c:/httpd/htdocs/autosetup/auto/test.php on line 25 > > > > > > <?php > > function getdata( ){ > > > ################################################################## > ########## > > ##### > > global $domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass; > > > > if(file_exists("userdata")) { > > $fp2=fopen ("userdata","r")or die("unable to open file > > ($userdata)"); > > flock($fp2, 2); //unless ($use_flock == 0); > > while ($data = fgetcsv ($fp2, 1000, "|")) { > > $num = count ($data); > > $row++; > > for ($c=0; $c<$num; $c++) { > > > > } > > list($domain,$tld,$firstname,$lastname,$userid,$passw,$email,$package, > > $frontpage,$mysql,$userdatabase,$newuser,$newuserpass) = $data; > > > > } > > > > //close and del file > > fclose ($fp2); > > //system ("del userdata"); > > } > > getdata( ) > > > > echo $domain; <--This is line 25 which is outside of the function > > echo $tld; > > echo $firstname; > > echo $lastname; > > echo $userid; > > echo $passw; > > echo $email; > > echo $package; > > echo $frontpage; > > echo $mysql; > > echo $userdatabase; > > echo $newuser; > > echo $newuserpass; > > > > > > ?> > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#47412) next »