Note that there are some explanatory texts on larger screens.

plurals
  1. POcheck field formmail
    primarykey
    data
    text
    <p>i am trying to change this:</p> <pre><code>foreach $require (@Required) { # If the required field is the email field, the syntax of the email # # address if checked to make sure it passes a valid syntax. # if ($require eq 'email' &amp;&amp; !&amp;check_email($Config{$require})) { push(@error,$require); } ////////////////////////////////////////////////////////////////////////////////// sub check_email { # Initialize local email variable with input to subroutine. # $email = $_[0]; # If the e-mail address contains: # if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || # the e-mail address contains an invalid syntax. Or, if the # # syntax does not match the following regular expression pattern # # it fails basic syntax verification. # $email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/) { # Basic syntax requires: one or more characters before the @ sign, # # followed by an optional '[', then any number of letters, numbers, # # dashes or periods (valid domain/IP characters) ending in a period # # and then 2 or 3 letters (for domain suffixes) or 1 to 3 numbers # # (for IP addresses). An ending bracket is also allowed as it is # # valid syntax to have an email address like: user@[255.255.255.0] # # Return a false value, since the e-mail address did not pass valid # # syntax. # return 0; } else { # Return a true value, e-mail verification passed. # return 1; } } </code></pre> <p>into this:</p> <pre><code>foreach $require (@Required) { if ($require eq 'fieldb' &amp;&amp; !&amp;check_fieldb($Config{$require})) { push(@error,$require); } /////////////////////////////////////////////////////////////////////////////// sub check_fieldb { # If field b is under 20% of field a: # if ($fieldb &lt;=($fielda/100)*20 ) { # Return a false value, since field b is less than 20% of field a return 0; } else { # Return a true value, fieldb verification passed. # return 1; } } </code></pre> <p>but it does not work, always returns as 0. how would i fix this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload