1
I have a question about how I can be passing the value of a textarea to a php function.
I have the following function:
function _dup($cclist) {
for ($i = 0; $i < count($cclist); $i++) {
$ccnum = info($cclist[$i]);
if (is_array($ccnum)) {
$cc = $ccnum['num'];
for ($j = $i + 1; $j < count($cclist); $j++) {
if (inStr(str_replace("-", "", str_replace(" ", "", $cclist[$j])), $cc))
$cclist[$j] = "";
}
}
}
foreach ($cclist as $i => $cc)
if ($cc == "")
unset($cclist[$i]);
$ok = array_values($cclist);
return $ok;
}
And to run the script I have this other function:
function check($ccnum, $ccmonth, $ccyear, $cccvv) {
$ccline = $ccnum."|".$ccmonth."|".$ccyear."|".$cccvv;
$action = new Run();
$action->addToCart();
$action->CCLINE = $ccline;
return $action->checkOut();
}
texarea will receive the value nome|cpf|mae|data so that function check can make your validation.
HTML
<form action="" method=post name=f> <textarea wrap="off" name=cclist cols=90 rows=20> </textarea><br> <br> <input style="width:100px" class="button" type=submit name=submit size=10 value="Valida"> </form>
The textarea is in a form?
– Lucas
<form action="" method=post name=f> <textarea wrap="off" name=cclist cols=90 Rows=20> </textarea><br> <br> <input style="width:100px" class="button" type=Submit name=Submit size=10 value="Valida"> </form>
– Rafael norton
Edit your question by placing this code (there is an edit button just up here)
– Lucas
Edited . could help me now ?
– Rafael norton
It would only be to submit the form to a PHP page that called the function. You’ve tried this?
– Lucas
Goes blank .
– Rafael norton
Hi, I don’t know if this was just during the creation of the question, or if you did the same in the script, but put the
aspasin the attributeshtml, and another thing is, where does the function_dupis called ? And what is her real function in the script ? I don’t really know what the code is about, but I get the impression that it’s a filter for certain data entered in thetextarea. I await return.– Edilson