Re: Interactive Commands

From: Date: Mon, 23 Oct 2000 16:05:09 +0000
Subject: Re: Interactive Commands
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-21799@lists.php.net to get a copy of this message
Because the first is a separate process, you're going to have a difficult time with this. Under Un*x, you can "echo oldpass\nnewpass\n | passwd" and it'll work. =) Whatever happens, once you launch your new process, then you're not using passthru anymore, but need something more "inter-process." The Un*x "pipe" works well for this. For more complex things, I'd write a quick shell script/C program to do the passwd call and put parameters off of it. ie, passthru(chpasswd old new verify) 'Luck! -Szii At 10:22 PM 10/22/00 -0700, Mukul Sabharwal wrote: >Hi, > >I was recently doing useless stuff with System(), >Exec(), Passthru, etc... and was wondering if i could >change my password using this : > >I tried : > >echo "<pre>"; > >passthru("whois devhome.net"); > >echo </pre>"; > >this works fine, but i can't seem to get this right : > >echo "<pre>"; > >passthru("passwd\noldpass\nnewpass\nnewspass"); > >echo "</pre>"; > >why doesn't this work, i'm not very familiar with how >to do interactive stuff... and how can i read the >output and on that basis make my decision.... maybe if >it says password too easy... but still i'll keep on >doing that... > >thanks. > >===== >To Find Out More About Me : http://mukul.tsx.org/ > >__________________________________________________ >Do You Yahoo!? >Yahoo! Messenger - Talk while you surf! It's FREE. >http://im.yahoo.com/ > >-- >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 (#21799) next »