Re: does this mean ....

From: Date: Tue, 23 Jul 2002 00:41:09 +0000
Subject: Re: does this mean ....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108993@lists.php.net to get a copy of this message
In article <DPEPKCNEFOKBCNNANCIPMEINCGAA.php@vfsa.com.au>, php@vfsa.com.au says... > hi all, > > I'm tring to make a script to prompt for a username & then a password = > for that user onto the actual machine rather than just a web site... > > now i've come across this this line in some documentation > > if ( $File =3D popen( "$useradd_prog $useradd_name", "r" ) ) > { > . > . > . > now to my actual question .. > > does that "r" just mean read? and if so should that "r" be a "w" > for = > write in order for it to work? > > > > Cheers=20 > > Peter=20 > "the only dumb question is the one that wasn't asked"=20 > =20 If you are just checking the name/password against an existing list, then you only need read. If you want to add something, then you need a different mode. However, I think you may be better off uing fopen, instead of popen, if you are trying to do what I think you are. The documentation for fopen has a comprehensive description of the modes available; note that w is kindof destructive in the wrong context :-) Cheers -- David Robley Temporary Kiwi! Quod subigo farinam

« previous php.general (#108993) next »