You are here: Re: How do you do TCL exec command on PHP script that uses user input? « PHP Programming Language « IT news, forums, messages
Re: How do you do TCL exec command on PHP script that uses user input?

Posted by Ulrich Schφbel on 10/12/34 11:33

Hi Phillip,

from catch's point of view it is an error, if your
php script exit with a status != 0 or writes to stderr.
If you don't like the name 'error' just give it another name.

Namen sind Schall und Rauch.

Ulrich


In article <1132588800.060082.202540@o13g2000cwo.googlegroups.com>,
"comp.lang.tcl" <phillip.s.powell@gmail.com> writes:
> I'm sorry but I do not understand. This is not an error. This is the
> correct result of the user entering just the carriage return instead of
> a string text value. Ok, "user error" if that makes sense, not "script
> error"
> Phil
> Ulrich SchΓΆbel wrote:
>> Hi Phillip,
>>
>> soory, I didn't follow the entire thread. From your description
>> I'd derive something like
>>
>> if {[catch {exec php ...........} error]} {
>> puts stderr $error
>> exit 1
>> }
>>
>> Then the Tcl script commits suicide on the death of your php script.
>>
>> Best regards
>>
>> Ulrich
>>
>> In article <1132585996.564652.204510@g49g2000cwa.googlegroups.com>,
>> "comp.lang.tcl" <phillip.s.powell@gmail.com> writes:
>> > The behavior I want is to reflect the behavior of the called PHP
>> > script.
>> >
>> > You will input some data. If you do NOT input some data (such as hit
>> > "Enter" instead of entering data), it will throw an error message and
>> > die. If you just sit there and enter nothing, it just sits there and
>> > does nothing until you enter something.
>> >
>> > That is how the PHP script works, which I will spare you from having to
>> > view PHP code to verify.
>> >
>> > The problem is that the TCL script, while it now successfully pipes in
>> > stdout and stderr, doesn't pipe in "exit()", the PHP function that
>> > reflected as such:
>> >
>> > [PHP]
>> > if (!$response) die('You must enter a username');
>> > [/PHP]
>> >
>> > Instead TCL just moves on to the next statement, instead of just dying
>> > at that spot.
>> >
>> > Phil
>> >
>> > Cameron Laird wrote:
>> >> In article <1132452443.558092.275200@g14g2000cwa.googlegroups.com>,
>> >> comp.lang.tcl <phillip.s.powell@gmail.com> wrote:
>> >> .
>> >> .
>> >> .
>> >> >Problem is that the PHP script contains an exit() function that dies if
>> >> >user does not input something upon prompting. The TCL script does not
>> >> >die, it keeps going, which is not the desired effect, but hey I'm
>> >> >halfway there already, thanx!!
>> >> .
>> >> .
>> >> .
>> >> You're welcome.
>> >>
>> >> Why is it a "[p]roblem ... that the PHP script contains
>> >> an exit() function that dies ..."? What sort of behavior
>> >> do you want? Do you want your Tcl script to undo this
>> >> setting? Are you saying that you want the Tcl coding to
>> >> allow user input, but to pass some default response
>> >> through to PHP if the user "times out"? Or are you saying
>> >> that you want to Tcl script to notice when the PHP one has
>> >> "died", and itself exit?
>> >

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация