Dear wise Monks,
I would like to ask you the following:
I have a PHP page that calls a Perl script to execute locally, and passes a number of arguments to it.
The arguments passed are:
1) input file
2) number of sequences in the input file
3) a text string
4) an indication if a textbox is selected or not by the user
5) the same as #4
The call of Perl script is made by PHP exec function:
exec ("perl Whole_Program.pl $input_file $seqs_number $prior_info $run
+_mode $txtbox1 $txtbox2", $res_total, $ret);
My problem has to do with #4 and #5. If the user has selected both text boxes, then the argument for
$txtbox1 and
$txtbox2 is 'on'.
However, if the user selects, say, only the second txtbox, then there is no value for
$txtbox1 variable, because the
@ARGV array contains 5 elements instead of 6.Is there a way to correct this? Because, if the user does not select one of the textboxes, then, the argument is not passed to the perl script.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.