Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: MOrac
  • Order by date
  1. MOrac

    getting value from a DIV tag

    Then you'll not find the value in the HTML methods; the data was never placed there. You'll need to use something like:parent.document.getElementById('para1').lastChildto get the last node added to para1; dependending on what type of node you've cloned will determine how you need to access it...
  2. MOrac

    getting value from a DIV tag

    What code do you use in the other call to set the data into para1? There's nothing obviously wrong with your reasoning thus far, but you've missed out half the code needed to answer you ;-)
  3. MOrac

    How to simplify this structure ?

    Note that I appear to have missed a couple of terminating semicolons in the above code example. Whoops! You'll also of course need to keep the code that sets the original values to $total and $sql and follow the loop with the check on $total that gives the exit(0) if no parameters were set.
  4. MOrac

    How to simplify this structure ?

    Your original code began: my $opt = new Getopt::Compact (name => 'program', struct => [[[qw(d days)], qq(start and end days), '=s', \my @days], [[qw(n name)], qq(persons name), '=s', \my $name], [[qw(a age)], qq(persons age), '=i', \$age], [[qw(l location)], qq(location)...
  5. MOrac

    Combining functions

    Just call the second function from the first. In this particular case I would add an array:var fieldCheck = Array(undef, check_email, undef);alongside fieldRequired and fieldDescription (where check_email is the name of your email-checking function), and then add:if (fieldCheck != undefined) {...
  6. MOrac

    How to simplify this structure ?

    Use iteration where it makes sense to do so. Your parameter list is already being fully definied and referenced in the struct you pass to GetOpt; use it. Instead of passing an anonymous array, store this somewhere real and use it to parse your data. For instance, if it becomes stored in...
  7. MOrac

    Editing Database Text

    Replace: (\w+) with: (.+)$ The original wants a continuous set of word-characters, so it stops at the first non-word character, which is the '.', but it would stop at the space also. The replacement will simply return everything. You can make this as complex as you like; this...
  8. MOrac

    Trying to login into a passworded webpage

    I'm guessing that you're using the Perl module WWW::Mechanize, but you don't say so. You should; it's tedious having to guess information you should be giving. To solve your problem: replace your code: my $url = $mech->uri; $content = get($url) || die "get: $!"; with: $content =...
  9. MOrac

    Who can tell me what this code wants to do ?

    The warn is triggered by any failure - but I feel it's unlikely that it was designed to fail on not getting the returns from the named functions. More likely is that it was for guarding against a failure by the package require statement and class instatiation, which can fail simply on bad...
  10. MOrac

    regex - delete all after .com, .edu., .org, .ent

    That appeared to be what you wanted, so that's what I set it to do. The following change to the regexp: /(\.(com|net|org|edu))[\.\/].*$/ will bypass that by leaving the suffix character out of the part of the string that's being kept. Incidentally...
  11. MOrac

    regex - delete all after .com, .edu., .org, .ent

    You would need something akin to a regular expression such as: /(\.(com|net|org|edu)[\.\/]).*$/ The replacement string would need to replace the first match expression, since this is part of the string that you wish to keep. Also, preg_replace outputs the replaced string, but does not modify...
  12. MOrac

    Who can tell me what this code wants to do ?

    It appears to be a class constructor which is a pseudo-wrapper for the constructors of the referenced DBIOImpl classes. If it was well designed it would become a child-class of the intercepted classes, but instead it seems to want to just contain the chosen class. Please note that I've no idea...
  13. MOrac

    running remote server program

    With that error message I suspect that your webserver user a) has no home directory (hence the default /) b) isn't root, so can't create /.ssh as an ssh configuration file container as / is almost always only writable to by root. The script is also trying to execute a strange...
  14. MOrac

    Differences between UNIX Perl-5 and AIX Perl-5 ?

    There are perfectly good, precompiled and free downloads for Perl on AIX all the way up to current releases for use within business. ActiveState are one such source, but there are a great many such. If you've the space to place the binaries without causing grief I'd simply recommend placing...
  15. MOrac

    Wait for Form to Submit

    I'd bow, but you'd not see me perform anyhow. The obfusticated code forum lives elsewhere ... sometimes clarity can be helpful too. Admittedly, I'm appalled at the number of grammatical flaws I can spot in that post now that I read it through. Obviously it's time to go and hang myself for a...
  16. MOrac

    Characters not recognized as characters

    Might I recommend the use of the fscanf string " %c%d%d%d%d%d%d%d%d%d%d%d%d" instead of "%c%d%d%d%d%d%d%d%d%d%d%d%d"? The use of the preceding space before the %c field enables the whitespace skip for the character type; the end-of-line markers would normally show up as such. I would suspect...
  17. MOrac

    Wait for Form to Submit

    Form submittal doesn't get 'acknowledged', it only causes an HTTP request to be sent. What the server does with that, typically, is return a page, just like any other request - unless you're strict with your server, most pages requests don't care whether you issue a GET or POST request for any...
  18. MOrac

    Regular Expression help

    You're pretty unclear as to what happens to any other text following the matching text, but you could try something like: function f(s, foo, bar, r) { var i1, i2; i1 = s.indexOf(bar); if (i1 >= 0) { i2 = s.indexOf(foo); if (i2 < 0 || i2 > i1) { return r + s.substr(i1 +...
  19. MOrac

    Securing my PHP script so other people can use it.

    I wouldn't. shc is a free method of stopping people easily reading or altering your source code and there are many such. Most of which are no worse than Zend at hiding code. All Zend adds for its $3k is a licensing model and a restrictive lock-in to PHP. As the PHP interpreter is open...
  20. MOrac

    Securing my PHP script so other people can use it.

    Anything your script does to verify itself can be spoofed by reading the script. Don't bother. It will cost you more many hours to generate any given segment of copy protection than it will take an equivalent programmer to remove or bypass it. It's only worth doing for something which would...

Part and Inventory Search

Back
Top